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/ 9
CS & IT
ENGINEERING C-Programming
Function & Storage Class
DPP.- 04 Discussion Notes By- Abhishek Sir [NAT] #Q. Consider the following program: int main(){ #include<stdio.h> int i, a=5, b=4; int f2(int a){ for(i=0;i<2;i++){ int b=0; b-=f1(a)-f2(a); b=b+5; printf("%d\t", b); return a*b; } } return 0; int f1(int a){ } int b; The sum of the printed values is ______ b=f2(a); return a*b; } [NAT] #Q. Consider the following program: #include<stdio.h> int f2(int a){ int b=0; b=b+5; return a*b; } int f1(int a){ int b; b=f2(a); return a*b; } [MCQ] #Q. Consider the following program: #include<stdio.h> void print(int n){ for(n++;n++;n++) printf("GATE Wallah"); } int main(){ void print(); void print(); print(-9); return 0; } Which of the following is correct? A Compilation error
B “GATE Wallah” will be printed infinite number of times.
C “GATE Wallah” will be printed 5 times.
D “GATE Wallah” will be printed 4 times.
[MCQ] #Q. Consider the following program. #include<stdio.h> void f(int n){ switch(n<<1+n){ default: printf("Sresth"); case 4: printf("Parakram"); case 3: printf("2024"); break; case 2: printf("2025"); A Parakram2024 } } B SresthParakram2024 int main(){ f(1); C Parakram return 0; } The output is- D Sresth2025 [NAT] #Q. Consider the following program: #include<stdio.h> int f(int b, int a){ int x; x=a<<b; b=x*a--; return a+b-x; } int main(){ printf("%d", f(1,2)); return 0; } The value printed is _______. [MCQ] #Q. Consider the following program: #include <stdio.h> int r(int num){ return --num; } int main(){ int n=4; for (r(n);r(n++);r(--n)) printf("%d\t",r(--n)); A 123 return 0; } B 1234 The output is- C 321