This section contains more frequently asked Programming In C Fundamental Multiple Choice Questions Answers in the various University Level and Competitive Examinations.
1. Comment on the output of following code:1. #include
2. main()
3. {
4. char *p = 0;
5. *p = ‘a’;
6. printf(“value in pointer p is %c\n”, *p);
7. }
- It will print a
- It will print 0
- Compile time error
- Run time error
C. Compile time error
2. Which of the following is a keyword used for a storage class?
- Printf
- externa
- auto
- scanf
C. auto
3. The prototype of the function in the header file isA]Stdio.h
- stdlib.h
- conio.h
- io.h
- Stdio.h
D. Stdio.h
4. Preprocessor Directives are used for –
- Macro Expansion
- File Inclusion
- Conditional Compilation
- All of these
B. File Inclusion
5. Which function is used to read character as you type ?
- getchar()
- getch()
- getche()
- Both (B) and (C
A. getchar()
6. Which format specifier is used to print the values of double type variable
- %If
- %Id
- %Iu
- %f
A. %If
7. What will be the output of the following program? Void main( ) { Int x []= {10,20,30,40,50}; Print f (“ \n %d %d %d %d “, x [4] ,3[x] ,x[2] ,1[x] ,x[0] ); }
- Error
- 10 20 30 40 50
- 50 40 30 20 10
- None of these
A. %If
8. Which of the following is not s keyword of ‘C’ ?
- auto
- register
- int
- function
A. %If
9. What will be the output ? #define SQUARE(X) X * X void main ( ) { printf (“\n Square = %d” , SQUARE(10+2) ); }
- Square = 144
- Square =32
- Square =122
- Square =12
A. %If
10. By default a function returns a value of type
- int
- char
- void
- None of these
A. %If