C Programming and Technical

Q. Predict the output or error
main()
{
int k=1;
printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE");
}

A. 1==1 is TRUE

Explanation: When two strings are placed together (or separated by white-space) they are concatenated (this is called as "stringization" operation). So the string is as if it is given as
"%d==1 is %s". The conditional operator( ?: ) evaluates to "TRUE".

Read Solution (Total 0)

C Other Question

Q. Predict the output or error
main()
{
int i=5,j=6,z;
printf("%d",i+++j);
}

A. 11

Explanation:the expression i+++j is treated as (i++ + j)
Q. What is use of void data type?

A. Void is an empty data type normally used as a return type in C/C++, C#, Java functions/methods to declare that no value will be return by the function. The another used of void is to declare the pointer in C/C++ where It is not sure what data type is addressed by the pointer.