We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10
CS & IT
ENGINEERING C-Programming
Control Flow Statements
DPP No - 01 Discussion Notes By- Abhishek Sir [NAT] #Q. #include <stdio.h> int main(void) { int i = 2, j = 3, k = 4; if (i < j ? 1 : 0) printf(“GATE”); else printf(“Wallah2023”); return 0; } The output of the program is ______. [MCQ] #Q. #include <stdio.h> void main( ) { int a, b, c, d; A 1 −2 4 a = 2; b = –1; c = 3; d = –4; if(a = b – c – d) B 3 1 0 printf(“%d%d%d”, a++, b--, c++); C 2 1 −3 else printf(“%d%d%d”, c--, ++ a, ++b); D 3 3 0 } The output is ______. [MCQ] #Q. #include <stdio. h> int main(void) { int a = 3 > 2 ? 0 ? 0 : 1 : 5; A GATE 2023 if(a == a – 1) print f(“GATE 2023”); B GATE WALLAH else C Compiler error print f(“GATE WALLAH”); return 0; D Garbage value } The output of the program is ______. [NAT] #Q. #include <stdio .h> void main( ) { int a; a = printf(“GATE Wallah 2023”); if(a%4 == 0) a = a + 5; else a = a – 5; printf(“%d”, a++); } The value of a at the end of the program is ___. [NAT] #Q. #include <stdio.h> void main( ){ int i, j, k; j = 4; k = 0; i = j < k ? k : j --; if(j < i) j = j + k – 1; if(j = = i) j = j – i; else j = j + -- k, printf(“%d”, j + k – i); } The output is ___. [NAT] #Q. Consider the following program: #include<stdio.h> int main() { int a=19, b=20; if(a++<b--) printf("%d",a+++--b); else printf("%d", ++a+--b); return 0; } The output is ____________. [MCQ] #Q. #include<stdio.h> void main() { int a=0; printf("%d", a); A 0Hi22 if(a=2){ B 0Hi20 printf("Hi"); printf("%d",a); C 0Bye0 }else{ printf("Bye"); D 0Hi00 } printf("%d", a); } The output string is: [MCQ] #Q. #include<stdio.h> void main() { int a=0, b=0; A CProgramming0 a=(a=4)||(b=1); if(a&&b) B CProgramming1 printf("CProgramming"); C GATE0 else printf(“GATE"); D GATE1 printf(“%d”, b); } The output is- THANK - YOU