0% found this document useful (0 votes)
31 views1 page

Debugging

The document contains a series of C programming questions and their respective answers. Each question tests knowledge of C syntax and behavior, with options provided for the correct answer. The answers are indicated as options A through D for each question.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views1 page

Debugging

The document contains a series of C programming questions and their respective answers. Each question tests knowledge of C syntax and behavior, with options provided for the correct answer. The answers are indicated as options A through D for each question.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.#include<stdio.

h>int main(){ char ch;int i;scanf("%c", &i);scanf("%d",


&ch);printf("%c %d", ch, i);}
A. Error: suspicious char to in conversion in scanf()
B. Error: we may not get input for second scanf() statement
C. No error
D. None of above
Answer: Option B
2.#include<stdio.h>int main(){int k=1;printf("%d == 1 is" "%s\n", k,
k==1?"TRUE":"FALSE");}
A. k == 1 is TRUE B. 1 == 1 is TRUE C.1 == 1 is FALSE D.K == 1
is FALSE
Answer: Option B
3.#include<stdio.h>int main(){float a=3.15529; printf("%2.1f\n", a);
}
A. 3.00 B. 3.15 C. 3.2 D. 3
Answer: Option C

4.#include<stdio.h>int main(){ printf("%%%%\n");


}
A. %%%%% B.%% C. No output D. Error
Answer: Option B

5.#include<stdio.h> int main(){ int a=250; printf("%1d#\n", a); }


A. 1250 B. 2 C. 50 D. 250
Answer: Option D

6.#include<stdio.h>int main(){ int i;printf("%d\n", scanf("%d", &i));}


A. 25 B. 2 C. 1 D. 5
Answer: Option C
7.#include<stdio.h>int main(){ int i=5,j; j=++i+++i+++i; printf(�%d %d�,i,j); }
A.5 24 B.24 ,5 C.8 24 D.24 8
Answer: Option C
8.#include<stdio.h> int main(){ int i=1; i=2+2*i++; printf(�%d�,i); }
A. 5 B . 8 C. 4 D.1
Answer: Option A
9.#include<stdio.h> int main(){ int a=2,b=7,c=10; c=a==b; printf(�%d�,c);}
A. 0 B.1 C. error D. non of above
Answer: Option A

10.#include<stdio.h>void main(){ int x; x=10,20,30; printf(�%d�,x);}


A. compile time error B.10 C.30 D.run time error
Answer: Option B
11.#include<stdio.h> int main(){ int x=100,y=20,z=5; printf(�%d %d %d�);}
A. error B.100 20 5 C.5 20 100 D. non of above
Answer: Option C

12.#include<stdio.h> int main(){ int i=2,j=2; while(i+1?�i:j++)printf(�%d�,i);}


A.1 B.0 C.error D.2
Answer: Option A

You might also like