Total 10 Questions. Each Carry 2 Marks.
Total Time 20 Minutes.
Quiz Summary
0 of 10 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 10 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 16 marks. Watch the concepts and examples. Again Take the test after a week.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- Current
- Review
- Answered
- Correct
- Incorrect
-
Question 1 of 10
1. Question
Q1) How many bytes of memory will be assigned to the below structure?
If int,float,and char takes 2,4,1 bytes respectively.
struct data
{
int x;
float y;
char a[20];
union
{
int j;
float k;
}
};CorrectIncorrect -
-
Question 2 of 10
2. Question
Q2) What is the output displayed by the below code?
#include <stdio.h>
struct data
{
int id;
char *name[1];
};
int main(void)
{
struct data x[2];
x[0].name[0]="learning";
printf("%s",++x[0].name[0]);
return 0;
}CorrectIncorrect -
Question 3 of 10
3. Question
Q3) What is the output displayed by the below code?
#include <stdio.h>
struct data
{
int id;
char name[10];
};
void f(struct data y)
{
y.name[0]='d';
}
int main(void)
{
struct data x;
x.id=101;
x.name[0]='m';
f(x);
printf("%c",x.name[0]);
return 0;
}CorrectIncorrect -
Question 4 of 10
4. Question
Q4)
Will the below code execute?
If yes type 0 in answer.
Otherwise type the count of number of lines having mistakes.
#include <stdio.h>
struct metadata
{
int metaid;
};
struct data
{
struct metadata d;
int id;
char name[10];
};
int main(void)
{
struct data x;
x.id=101;
x.name[0]='m';
x.d.metaid=1;
printf("%c",x.name[0]);
return 0;
}CorrectIncorrect -
-
Question 5 of 10
5. Question
Q5) What is the output displayed by the below code?
#include <stdio.h>
void f(struct data y)
{
y.name[0]='d';
}
int main(void)
{
struct data
{
int id;
char name[10];
};
struct data x;
x.id=101;
x.name[0]='m';
f(x);
printf("%c",x.name[0]);
return 0;
}CorrectIncorrect -
Question 6 of 10
6. Question
Q6) How many bytes of memory is created by the below program?
If int and pointer take 2 and 4 bytes respectively.
#include <stdio.h>
#include<stdlib.h>
int main(void)
{
struct data
{
int id;
char *p;
};
typedef struct data data;
data *temp;
int i;
for(i=0;i<2;i++)
{
temp=(data *)malloc(sizeof(data));
}
return 0;
}CorrectIncorrect -
-
Question 7 of 10
7. Question
Q7) Will the below code had access to all the memory created by the code?
#include <stdio.h>
#include<stdlib.h>
int main(void)
{
struct data
{
int id;
char *p;
};
typedef struct data data;
data *temp;
int i;
for(i=0;i<2;i++)
{
temp=(data *)malloc(sizeof(data));
}
temp->id=101;
temp->p="monkey";
return 0;
}CorrectIncorrect -
Question 8 of 10
8. Question
Q8) What is the output displayed by the below code?
#include <stdio.h>
#include<stdlib.h>
int main(void)
{
struct data
{
int id;
int age;
};
struct data x[10];
int i,sum=0;
//code to take ten id's and age values into x
for(i=0;i<10;i++)
{
sum=sum+x[i].age;
x[i].age=sum;
}
printf("%d",x[9].age);
return 0;
}CorrectIncorrect -
Question 9 of 10
9. Question
Q9) what is the output displayed by the below code?
#include <stdio.h>
#include<stdlib.h>
int main(void)
{
struct data
{
int id;
char name[10];
};
struct data x[]={{1,"ramesh"},{2,"suresh"},{3,"mahesh"}};
printf("%d%s",x[2].id,(*(x+2)).name);
return 0;
}CorrectIncorrect -
Question 10 of 10
10. Question
Q10) What is the output displayed by the below code?
#include <stdio.h>
#include<stdlib.h>
int main(void)
{
struct data
{
int id;
int age;
};
struct data d1={1,30};
struct data d2=d1;
if(d1==d2)
{
printf("hello");
}
else
{
printf("bye");
}
return 0;
}CorrectIncorrect