Total Time 30 Minutes.
Each Question 2 Marks. Total 15 Questions.
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 examples 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) What is the output displayed by the below program?
#include<stdio.h>
int f(int n)
{
if(n!=0)
return n+n*f(n-1);
else
return n;
}
int main()
{
int n=5;
int z;
z=f(n);
printf("%d",z);
return 0;
}CorrectIncorrect -
Question 2 of 15
2. Question
Q2) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
int b1=1010,b2=1000;
int i=0,rem=0;
int a[20];
while(b1!=0 || b2!=0)
{
a[i++]=(b1%10+b2%10+rem)%2;
rem=(b1%10+b2%10+rem)/2;
b1=b1/10;
b2=b2/10;
}
if(rem!=0)
{
a[i++]=rem;
--i;
}
while(i>=0)
printf("%d",a[i--]);
return 0;
}CorrectIncorrect -
Question 3 of 15
3. Question
Q3) What is the output displayed by the below program?
#include<stdio.h>
void f(int *p,int m)
{
m=m-5;
*p=*p-m;
}
int main()
{
int i=10,j=5;
f(&i,j);
printf("%d",i+j);
return 0;
}CorrectIncorrect -
-
Question 4 of 15
4. Question
Q4) What is the output displayed by the below code?
#include<stdio.h>
int f(unsigned int n)
{
int x=0;
while(n!=0)
{
if(n&01)
x++;
n>>=1;
}
return x;
}
int main( )
{
int n=12;
int z;
z=f(n);
printf("%d",z);
return 0;
}CorrectIncorrect -
Question 5 of 15
5. Question
Q5) What is the output displayed by the below program?
#include<stdio.h>
int f1(int n,int *fp)
{
int t,f;
if(n<=1)
{
*fp=1;
return 1;
}
t=f1(n-1,fp);
f=t+*fp;
*fp=t;
return f;
}
int main()
{
int x=15;
printf("%d",f1(5,&x));
return 0;
}CorrectIncorrect -
-
Question 6 of 15
6. Question
Q6) What is the output displayed by the below program?
#include<stdio.h>
void f1(int a,int b)
{
int c;
c=a;
a=b;
b=c;
}
void f2(int *a,int *b)
{
int c;
c=*a;
*a=*b;
*b=c;
}
int main()
{
int a=4,b=5,c=6;
f1(a,b);
f2(&a,&c);
printf("%d",c-a-b);
return 0;
}CorrectIncorrect -
-
Question 7 of 15
7. Question
Q7) Consider the code given below.
#include<stdio.h>
void f(int, short);
int main()
{
int i=100;
short s=12;
short *p=&s;
-------------; // call to f()
return 0;
}
which of the following expressions when placed in the blank above will not result in type checking errorCorrectIncorrect -
Question 8 of 15
8. Question
Q8) What is the output displayed by the below program?
#include<stdio.h>
void m(int *ptra,int *ptrb)
{
int *temp;
temp=ptrb;
ptrb=ptra;
ptra=temp;
}
int main()
{
int a=2016,b=0,c=4,d=42;
m(&a,&b);
if(a<c)
m(&c,&a);
m(&a,&d);
printf("%d",a);
return 0;
}CorrectIncorrect -
-
Question 9 of 15
9. Question
Q9) What is the output displayed by the below code?
#include<stdio.h>
#include<stdlib.h>
int *assignval(int *x,int val)
{
*x=val;
return x;
}
int main()
{
int *x=(int *)malloc(sizeof(int));
if(NULL==x)
return 0;
x=assignval(x,0);
printf("%d",*x);
return 0;
}CorrectIncorrect -
Question 10 of 15
10. Question
Q10) What is the output displayed by the below code?
#include<stdio.h>
int counter =0;
int calc(int a,int b)
{
int c;
counter++;
if(b==3)
return(a*a*a);
else
{
c=calc(a,b/3);
return(c*c*c);
}
}
int main()
{
calc(4,81);
printf("%d",counter);
return 0;
}CorrectIncorrect -
Question 11 of 15
11. Question
Q11) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
float x=8.28;
double y=8.28;
if(x==y)
printf("learning");
else
printf("monkey");
return 0;
}CorrectIncorrect -
-
Question 12 of 15
12. Question
Q12) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
char t;
char a[10]={1,2,3,4,5,6,7,8};
t=(a+1)[2];
printf("%d",t);
return 0;
}CorrectIncorrect -
Question 13 of 15
13. Question
Q13) What is the output displayed by the below code? [if error type 0 in the answer]
#include<stdio.h>
#define a "klmn"
int main()
{
printf("%c",a[2]);
return 0;
}CorrectIncorrect -
-
Question 14 of 15
14. Question
Q14) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
typedef static int *i;
int j;
i a=&j;
printf("%d",*a);
return 0;
}CorrectIncorrect -
Question 15 of 15
15. Question
Q15) What is the output displayed by the below code? [if error type 0 in answer]
#include<stdio.h>
int main()
{
char *p="Learning";
printf("%c",*&*p);
return 0;
}CorrectIncorrect -