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 again after a weak.
- 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)
{
static int a=0;
if(n>0)
{
a=a+1;
f(n/10);
}
else
{
return a;
}
}
int main()
{
int z;
z=f(111);
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>
#include<math.h>
int f(int n)
{
int iter=0,sum=0,po,rem;
while(n>0)
{
rem=n%10;
po=pow(8,iter);
sum=sum+po*rem;
iter++;
n=n/10;
}
return sum;
}
int main()
{
int z;
z=f(187);
printf("%d",z);
return 0;
}CorrectIncorrect -
-
Question 3 of 15
3. Question
Q3) The below code is displaying the following pattern.
1
12
123Identify the incorrect statement?
#include<stdio.h>
int main()
{
int i=1; //Statement 1
while(i<=3)
{
int j;//Statement 2
while(j<=i) //Statement 3
{
printf("%d",j);
printf(" ");
j=j+1;//Statement 4
}
printf("\n");
i=i+1;
}
return 0;
}CorrectIncorrect -
Question 4 of 15
4. Question
Q4) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
char *s[]={"learning","is","monkey"};
char **p;
p=s;
printf("%s ",++*p);
printf("%s ",*p++);
printf("%s ",++*p);
return 0;
}CorrectIncorrect -
Question 5 of 15
5. Question
Q5) What is the output displayed by the below code?
#include<stdio.h>
#include<string.h>
int main()
{
int a=12,b=5;
if((a^b)&&(a&b))
a=b;
printf("%d",a+b);
return 0;
}CorrectIncorrect -
Question 6 of 15
6. Question
Q6) What is the memory given to t and u in the below code?
Assume objects of type short, float, long take 2,4,8 bytes respectively. Ignore alignment considerations.
struct
{
short p[10];
union
{
short a;
float b;
long z;
}u;
}t;CorrectIncorrect -
Question 7 of 15
7. Question
Q7)
Consider the following function declaration.
int * f(int *)
Which of the following is correct about declaration.
CorrectIncorrect -
Question 8 of 15
8. Question
Q8) How many zero’s diaplayed by below program?
#include<stdio.h>
void main( )
{
static int i = 5;
if(--i)
{
main( );
printf("%d", i);
}
}CorrectIncorrect -
-
Question 9 of 15
9. Question
Q9) Choose the correct option.
#include<stdio.h>
struct node
{
int i;
float j;
};
struct node *s[10];
define s to beCorrectIncorrect -
Question 10 of 15
10. Question
Q10) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
char s1[7]="1234",*p;
p=s1+2;
*p=0;
printf("%s",s1);
return 0;
}CorrectIncorrect -
Question 11 of 15
11. Question
Q11)
Assume c compiler follows row major order for arrays.
Char a[100][100] was declared
The array is stored starting from address 0.
the address of a[40][50] is?
Assume memory is byte addressableCorrectIncorrect -
Question 12 of 15
12. Question
Q12) What is the output displayed by the below code?
#include<stdio.h>
#define print(x) printf("%d",x)
int x;
void q(int z)
{
z+=x;
print(z);
}
void p(int *y)
{
int x=*y+2;
q(x);
*y=x-1;
print(x);
}
int main()
{
x=5;
p(&x);
print(x);
return 0;
}CorrectIncorrect -
Question 13 of 15
13. Question
Q13) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
char num='\010';
printf("%d",num);
}CorrectIncorrect -
Question 14 of 15
14. Question
Q14) What is the output displayed by the below program?
#include<stdio.h>
int main()
{
int a=5;
a=1,2,3;
printf("%d",a);
return 0;
}CorrectIncorrect -
Question 15 of 15
15. Question
Q15) What is the output displayed by the below code?
#include<stdio.h>
int main()
{
int a[5]={1,2,3,4,5};
printf("%d",(&a+1)-(&a));
return 0;
}CorrectIncorrect -