Solved MCQ on C Programming Language set-5
1. What will be output of the following C program? #include
A) 5
B) 10
C) **
D) compilation error
2. Output of the following C program fragment is. x=5; y=x++; printf("%d %d", x,y);
A) 5, 6
B) 5, 5
C) 6, 5
D) 6, 6
3. What will be output of the following C program? #include
A) 10
B) 20
C) 30
D) compilation error
4. Following program fragment. main(){ printf("%p\n", main( ) ); }
A) Prints the address of main function
B) Prints 0
C) Is an error
D) In an infinite loop
5. What will be output of the following program? #include
A) 0
B) 7
C) 10
D) 2
6. What is the output of the following program segment? main( ) { long i=65536; printf("%d\n", i); }
A) 0
B) 65536
C) -1
D) 65
7. What will be the output of the program? # include
A) 2, 1, 15
B) 1, 2, 5
C) 3, 2, 15
D) 2, 3, 20
8. What is the output of the following program segment? main( ) { int=1; do { printf("%d . . ", i); } while (i--); }
A) 0 . . 1 . .
B) 1 . . 0 . .
C) 0
D) -1
9. Output of the program below is. int i; main( ) { printf("%d", i); }
A) 1
B) 0
C) -1
D) Null
10. What will be the output of the following program? main( ) { int i=5; printf("%d", i=++i==6); }
A) 0
B) 7
C) 6
D) 1
Answers:
1. What will be output of the following C program? #include
A) 5
2. Output of the following C program fragment is. x=5; y=x++; printf("%d %d", x,y);
C) 6, 5
3. What will be output of the following C program? #include
B) 20
4. Following program fragment. main(){ printf("%p\n", main( ) ); }
A) Prints the address of main function
5. What will be output of the following program? #include
A) 0
6. What is the output of the following program segment? main( ) { long i=65536; printf("%d\n", i); }
A) 0
7. What will be the output of the program? # include
C) 3, 2, 15
8. What is the output of the following program segment? main( ) { int=1; do { printf("%d . . ", i); } while (i--); }
B) 1 . . 0 . .
9. Output of the program below is. int i; main( ) { printf("%d", i); }
B) 0
10. What will be the output of the following program? main( ) { int i=5; printf("%d", i=++i==6); }
D) 1
Related Posts
- Solved MCQ of C set-1
- Objective Questions of C with answer set-2
- Solved MCQ of Programming in C set-3
- MCQ on C Programming With Answers set-4
- Solved MCQ of C++ Set-1
- MCQ of C++ with answer Set-2
- MCQ Questions of C++ With Answers set-3
- Solved Multiple Choice Questions of C++ set-4
- Solved MCQ of Programming in C++ set-5
Solved MCQ on C Programming Language set-5
Reviewed by mohamed
on
8:18 ص
Rating:
ليست هناك تعليقات: