C-Programming

6. Which of the following is a correct way to comment a single line in C?

a) / This is a comment

b) // This is a comment

c) /* This is a comment */

d) # This is a comment

View Answer >

7. What is the output of the following code snippet?

#include<stdio.h>

int main()

{

   int i = 0;

   for(i = 0; i < 5; i++);

   printf(“%d”, i);

   return 0;

}

a) 5

b) 0

c) 6

d) 1

View Answer >

8. What is the correct operator to perform logical AND in C?

a) &

b) &&

c) |

d) ||

View Answer >

9. Which of the following escape sequences represents a new line in C?

a) \n

b) \t

c) \r

d) \\

View Answer >

10. What is the output of the following code snippet?

#include<stdio.h>

int main()

{

   int x = 5;

   int y;

   y = x++ + x++;

   printf(“%d”, y);

   return 0;

}

a) 10

b) 12

c) 11

d) 13

View Answer >

Leave a Comment

Note:- All Study Material Job Notice/Results/Exams/Marks/Admit Card published on this website is only for immediate information purpose. This information is not to be a Legal Document/Information. If in case any mistake, error and maybe wrong, then this website is not responsible. WE DONT HAVE ANY YOUTUBE CHANNEL.