C Programming String Multiple choice question

Exercise : - Multiple Choice Question On C Programming, MCQ C Programming String

This section contains a lot of c programming question and answer with explanation on the topic string. These question and answer are very much helpful for interview(campus interviews, walkin interviews, company interviews), competitive examination ,entrance test and placements. Each question having answer and explanation that would help you to understand easily. These question are designed from basic to advance level. So anyone can learn from here (beginner, fresher, engineering graduate, an experienced IT professional).

All the question of c programming are listed below on string along with detailed explanation / solution and answer.

6) What would be the output of the following C programs ?
                                                                          

#include<stdio.h> void main(){ char arr[11]="The Quick brown fox"; printf("%s",arr); }

A. The Quick brown
B. The
C. The Quick brown fox
D. Compilation Error

Answer:

Compilation Error

Option:

( D )


Explanation :

Size of any character array cannot be less than the number of characters in any string which it has assigned.


7) What will be output when you will execute following c code ?
                                                                          

#include<stdio.h> void main(){ char data[2][3][2]={0,1,85,3,4,50,6,9,8,9,10,11}; printf("%o",data[0][2][1]); }

A. 50
B. 62
C. 11
D. Compilation Error

Answer:

62

Option:

( B )


Explanation :

No explanations available for this question.


8) What will be output when you will execute following c code ?
                                                                          

#include<stdio.h> void main(){ short num[3][2]={3,6,9,12,15,18}; printf("%d %d",*(num+1)[1],**(num+2)); }

A. 18 18
B. 12 15
C. 15 15
D. Compilation Error

Answer:

15 15

Option:

( C )


Explanation :

No explanations available for this question.