Total 15 Questions. Each Question Carry 2 Marks.
Total Time 30 Minutes.
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) What is the output displayed by the below code?
#include<stdio.h>
#include<string.h>
int f(int a,int b)
{
if(a==0)
return b;
else if(a==1)
return b+1;
else
return f(a-1,a+b+5);
}
int main()
{
int a=3,b=4;
int z;
z=f(a,b);
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 f(int a)
{
int p=1;
if(a>0)
return p+f(a-1);
else
{
p=p+1;
return a+p;
}
}
int main()
{
int a=2;
int z;
z=f(a);
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>
int main( )
{
static char[3][4]={"lmno","uvwx","fghi"};
putchar(**a);
return 0;
}CorrectIncorrect -
Question 4 of 15
4. Question
Q4) choose the correct option.
#include<stdio.h>
void swap(int a,int b)
{
int temp;
temp=a;
a=b;
b=temp;
}
In order to exchange the values of two variables x and yCorrectIncorrect -
Question 5 of 15
5. Question
Q5) What is the output displayed by the below code?
#include<stdio.h>
struct node
{
char x,y,z;
};
int main()
{
struct node p={'1','0','a'+2};
struct node *q=&p;
printf("%c %c",*((char *)q+1),*((char *)q+2));
return 0;
}CorrectIncorrect -
Question 6 of 15
6. Question
Q6) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
int arr[]={1,2,3,4,5,6,7,8,9,0,1,2,5};
int *ip=arr+4;
printf("%d",(ip[1]));
return 0;
}CorrectIncorrect -
Question 7 of 15
7. Question
Q7) What does the following function return?
int t(int a,int b,int c)
{
if((a>=b) && (c<b))
return b;
else if(a>=b)
return t(a,c,b);
else
return t(b,a,c);
}CorrectIncorrect -
Question 8 of 15
8. Question
Q8) What is theoutput displayed by the below code?
#include<stdio.h>
void swap(int *x,int *y)
{
static int *temp;
temp=x;
x=y;
y=temp;
}
void printab()
{
static int i, a=-3,b=-6;
i=0;
while(i<=4)
{
if((i++)%2==1)
continue;
a=a+i;
b=b+i;
}
swap(&a,&b);
printf("a=%d,b=%d\n",a,b);
}
int main()
{
printab();
printab();
return 0;
}CorrectIncorrect -
Question 9 of 15
9. Question
Q9) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
char num=127;
num=num+1;
printf("%d",num);
return 0;
}CorrectIncorrect -
Question 10 of 15
10. Question
Q10) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
char *ptr="learning%s";
printf(ptr);
return 0;
}CorrectIncorrect -
Question 11 of 15
11. Question
Q11) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
static int num=3;
if(--num)
{
main();
printf("%d",num);
}
return 0;
\}CorrectIncorrect -
Question 12 of 15
12. Question
Q12) What is the output displayed by the below code?
#include<stdio.h>
void f(int c[][3])
{
++c;
c[1][1]=15;
}
int main()
{
int a[3][3]={{1,2,3},{4,5,6},{7,8,9}};
f(a);
printf("%d",a[2][1]);
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[]={1.3,2.7,3.5,4.8,5};
int *ptr=a,i;
for(i=0;i<5;i++)
{
printf("%d ",*ptr);
++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 a[]={0,1,2,3,4};
int *p[]={a,a+1,a+2,a+3,a+4};
int **ptr=p;
++*ptr;
printf("%d%d%d",ptr-p,*ptr-a,**ptr);
return 0;
}CorrectIncorrect -
Question 15 of 15
15. Question
Q15) Assume int and pointer take 4 and 4 bytes of 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 -