C Programming and Technical

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.

Read Solution (Total 1)

C Other Question

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".
Q. Four type of scope in c:

A. Block scope.
Function scope.
File scope.
Program scope