Total Time 30 Minutes. Total 15 Questions.
Each Question Carry 2 Marks.
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
0 of 15 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
-
If you score less than 24 marks. Please watch the example videos and take the test after a week.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- Current
- Review
- Answered
- Correct
- Incorrect
-
Question 1 of 15
1. Question
Q1) How many numbers are printed by the below program?
#include<stdio.h>
int f()
{
static int num=40;
return num--;
}
int main()
{
for(f();f();f())
{
printf("%d ",f());
}
return 0;
}CorrectIncorrect -
-
Question 2 of 15
2. Question
Q2) What is the output displayed by the below code?
#include<stdio.h>
int f(int p,int q)
{
int k=0;
if(p>0 && q>0)
{
k=k+1;
f(p-1,q);
}
return k;
}
int main()
{
int i=2,j=3,z;
z=f(i,j);
printf("%d",z);
return 0;
}CorrectIncorrect -
Question 3 of 15
3. Question
Q3) What is the output displayed by the below code?
#include<stdio.h>
#include<string.h>
int main()
{
char a[10]={'m','m','o','m'};
int len,i;
len=strlen(a);
for(i=1;i<=2;i++)
{
len++;
a[len]='m';
}
len=strlen(a);
printf("%d",len);
return 0;
}CorrectIncorrect -
-
Question 4 of 15
4. Question
Q4) What is the output displayed by the below code?
#include<stdio.h>
int main( )
{
int a();
a();
(*a)();
return 0;
}
int a()
{
printf("come");
}CorrectIncorrect -
Question 5 of 15
5. Question
Q5) Choose the correct option of the following expressions.
int *a[10],b[10[10];
1) a[2]
2) a[2][3]
3) b[1]
4) b[2][3]
which will not give compile time errors if used as left hand sides of assignment statements in c language?
CorrectIncorrect -
Question 6 of 15
6. Question
Q6) What is the output displayed by the below code?
#include<stdio.h>
void printxy(int x,int y)
{
int *ptr;
x=0;
ptr=&x;
y=*ptr;
*ptr=1;
printf("%d %d",x,y);
}
int main()
{
int x=1,y=1;
printxy(1,1);
return 0;
}CorrectIncorrect -
Question 7 of 15
7. Question
Q7) What is the output displayed by the below code?
#include<stdio.h>
int j(int x,int y)
{
x=2*x+y;
return x;
}
int main()
{
int x=2,y=5;
y=j(y,x);
x=j(y,x);
printf("%d",x);
return 0;
}CorrectIncorrect -
-
Question 8 of 15
8. Question
Q8) What are the values displayed by the below program?
#include<stdio.h>
void foo(int n,int sum)
{
int k=0,j=0;
if(n==0)
return;
k=n%10;
j=n/10;
sum=sum+k;
foo(j,sum);
printf("%d",k);
}
int main()
{
int a=2048,sum=0;
foo(a,sum);
printf("%d",sum);
return 0;
}CorrectIncorrect -
Question 9 of 15
9. Question
Q9) Assume char, int, and pointer take memory 1,2,4 bytes respectively.
What is the output displayed by the below program?
#include<stdio.h>
int main()
{
char *p;
printf("%d%d",sizeof(*p),sizeof(p));
return 0;
}CorrectIncorrect -
Question 10 of 15
10. Question
Q10) Which of the given option will display 5?
#include<stdio.h>
int main()
{
int a[1][2][3]={0};
a[0][1][2]=5;
return 0;
}CorrectIncorrect -
Question 11 of 15
11. Question
Q11) What is the output displayed by below code?
#include<stdio.h>
int main()
{
int a[5][5][4]={0};
int *b=a;
int *c=a+1;
printf("%d",c-b);
return 0;
}CorrectIncorrect -
Question 12 of 15
12. Question
Q12) Assume int and pointer take 4 and 4 bytes memory respectively.
What is the output displayed by the below code?
#include<stdio.h>
int main()
{
int a[]={1,2,3,4,5};
printf("%d", sizeof(a));
return 0;
}CorrectIncorrect -
-
Question 13 of 15
13. Question
Q13) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
int a = 130;
char *ptr;
ptr=(char *)&a;
printf("%d",*ptr);
return 0;
}CorrectIncorrect -
Question 14 of 15
14. Question
Q14) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
int i=3;
int *j;
int **k;
j=&i;
k=&j;
k++;
printf("%d",**k);
return 0;
}CorrectIncorrect -
Question 15 of 15
15. Question
Q15) What is the output displayed by the below code?
#include<stdio.h>
int a,b,c=0;
void pf(void)
{
static int a=2;
int b = 1;
a+= ++b;
printf("\n%d%d",a,b);
}
int main()
{
static int a=1;
pf();
a+=1;
pf();
printf("\n%d%d",a,b);
return 0;
}CorrectIncorrect