Programming and Data Structures (GATE (Graduate Aptitude Test in Engineering) Computer Science): Questions 116 - 121 of 151
Get 1 year subscription: Access detailed explanations (illustrated with images and videos) to 913 questions. Access all new questions we will add tracking exam-pattern and syllabus changes. View Sample Explanation or View Features.
Rs. 450.00 or
Question number: 116
» Programming and Data Structures » Programming in C
Question
What will be output if you will compile and execute the following code?
void main()
{
int a,b;
a=1,3,15;
b=(2,4,6);
clrscr();
printf("%d ",a+b);
getch();
}
Choices
Choice (4) | Response | |
---|---|---|
a. | 21 |
|
b. | 17 |
|
c. | 7 |
|
d. | 3 |
|
Question number: 117
» Programming and Data Structures » Programming in C
Question
What will be output if you will compile and execute the following c code?
void main()
{
int i;
float a=5.2;
char *ptr;
ptr=(char *)&a;
for(i=0;
i<=3;
i++) printf("%d ",*ptr++);
}
Choices
Choice (4) | Response | |
---|---|---|
a. | Garbage |
|
b. | 102 56 - 80 32 |
|
c. | 102 102 - 90 64 |
|
d. | 3 edges 0 0 0 0 |
|
Question number: 118
» Programming and Data Structures » Programming in C
Question
What will be output if you will compile and execute the following code?
void main()
{
char *str="c-pointer";
printf("%*.*s",10,7,str);
}
Choices
Choice (4) | Response | |
---|---|---|
a. | c-pointer |
|
b. | c-pointer null |
|
c. | c-point |
|
d. | null |
|
Question number: 119
» Programming and Data Structures » Programming in C
Question
How many different trees are possible with 10 nodes?
Choices
Choice (4) | Response | |
---|---|---|
a. | 1014 |
|
b. | 1200 |
|
c. | 1400 |
|
d. | 1000 |
|
Question number: 120
» Programming and Data Structures » Programming in C
Question
What will be output if you will compile and execute the following c code?
int extern x;
int extern x;
void main() {
printf("%d", x);
x = 2;
getch();
}
int x = 23;
Choices
Choice (4) | Response | |
---|---|---|
a. | 0 |
|
b. | 23 |
|
c. | 2 |
|
d. | error |
|
Question number: 121
» Programming and Data Structures » Programming in C
Question
What will be output if you will compile and execute the following c code?
void main()
{
if(printf("cquestionbank")) printf("I know c");
else printf("I know c++");
}
Choices
Choice (4) | Response | |
---|---|---|
a. | I know c |
|
b. | I know c++ |
|
c. | know Java |
|
d. | None of the above |
|