MCQ Set 1 - C

15 Questions | Attempts: 141
Please wait...
Question 1 / 16
🏆 Rank #--
Score 0/100

1. What is the output of the following 'C' program?
main ( )
{
printf ('' % f '', sqrt (36.0));
}

Submit
Please wait...
About This Quiz
MCQ Quizzes & Trivia

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. What is the output of the following 'C' program?
main ( )
{
int a [5] = {2, 3};
print f (''\n % d % d % d'', a [2], a [3], a [4]);

Submit

3. What is the output of the following 'C' program? main ( )
{
printf (''% d % d % d", sizeof(3.14 f),
sizeof (3.14), sizeof (3.14 l));
}

Submit

4. We want to round off x, a float, to an int value. What is the correct way to do so?

Submit

5. By default any real number in 'C' is treated as

Submit

6. What is the output of the following 'C' program?
main
{
printf (''%c'', ''abcdefgh'' [4]);

Submit

7. In the following 'C' code in which order the functions would be called?
a = (f 1 (23, 14) * f 2 (12 / 4) + f 3 ( ));

Submit

8. What is the output of the following 'C' program?
main ( )
{
int x = 10, y = 10, z = 5, i;
i = x <y <z;
printf ("\n % d'', i); }

Submit

9. What is the output of the following 'C' program?
main ( )
{
extern int i;
i = 20;
print ( "% d'', sizeof(i));
}

Submit

10. Consider the following program:
main ( )
{
int x = 2, y = 5;
if (x < y) return (x = x + y);
else print f("zl");
print f("z2");
}
Then

Explanation

Return always terminates the function that executed it. main ( ) being a function, will be terminated when it executes the return statement. The return value will be returned to the calling environment, which is the operating system in this case.

Submit

11. Which header file should you include if you are to develop a function that can accept variable number of arguments?

Submit

12. What is the output of the following 'C' program?
main ( )
{
int i = 2;
print f (''\n % d % d'', + + i, + + i);

Submit

13. What is the output of the following 'C' program?
main
{
Float a = 0. 7;
if (a < 0.7)
print f (''C'');
else
print f ('' C + + '');
}

Submit

14. What is the output of the following 'C' program?
main ( )
{
char str [7] = ''strings'';
print ('' % c ''; str);
}

Submit

15. The following program
main ( )
{
static int a { } = {7, 8, 9};
print f("%d", a {2} = 2 [a] + A [2];

}

Explanation

a [2] will be converted to * (a + 2)
* (a + 2) can sas well be written as * (2 + a)
* (2 + a) is nothing but 2 [a]. So, a [2] is sam eas 2 [a], which is same as * (2 + a). So, it prints 9 + 9 = 18

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (15)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
What ...
What ...
What ...
We ...
By default any real number in 'C' is treated as
What ...
In ...
What ...
What ...
Consider ...
Which ...
What ...
What ...
What ...
The ...
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!