C Quiz – 107 | Question 3

In a C program snippet, followings are used for definition of Integer variables?





signed s;
unsigned u;
long l;
long long ll;


Pick the best statement for these.
(A) All of the above variable definitions are incorrect because basic data type int is missing.
(B) All of the above variable definitions are correct because int is implicitly assumed in all of these.
(C) Only “long l;” and “long long ll;” are valid definitions of variables.
(D) Only “unsigned u;” is valid definition of variable.

Answer: (B)

Explanation: Please note that signed, unsigned and long all three are Type specifiers. And int is implicitly assumed in all of three.
As per C standard, “int, signed, or signed int” are equivalent. Similarly, “unsigned, or unsigned int” are equivalent. Besides, “long, signed long, long int, or signed long int” are all equivalent. And “long long, signed long long, long long int, or signed long long int“ are equivalent.

Quiz of this Question

GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details

My Personal Notes arrow_drop_up
Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.