What will be output of following program?
#include
#include
int main(){
char far *p,*q;
printf("%d %d",sizeof(p),sizeof(q));
return 0;
}
2 2
4 4
4 2
2 4
Answer: Option B
What will be output of following program?
#include
#include
int main(){
int register a;
scanf("%d",&a);
printf("%d",a);
return 0;
}
//if a=25
25
Address
0
Compilation error
Answer: Option D
Mitti wants to find the largest number in a given 20 numbers. Which of the following is an efficient approach to do this?
Use bubble sort to sort the list in descending order and then print the first number of the series.
Use selection sort to sort the list in descending order and then print the first number of the series
Implement one iteration of selection sort for descending order and print the first number in the series.
None of these
Answer: Option C
What will be output of following program?
#include
Int main(int argc, char** argv)
{
Int i Var=0,iCnt, 0aiArr[]={56,23,4,89,-200,34};
For (iCnt=1;iCnt<6;iCnt++)
{
If (a I Arr [iCnt] iVar=iCnt;
}
printf("%d",iVar);
return0;
}
4
89
3
-200
Answer: Option A
Which of the following is function of relational operator?
It assigns one operand to another.
It compares two operands
It logically combines two operands
None of these
Answer: Option B
Follow the code snippet and chose the correct statement(s)
Int x;
void f2()
{
Int x=1; // line1
::x=2; // line2
x=2; //line3
}
The statement in line1 throws a compilation error
In line2,x=2 is assigned to the global x
In line3,x=2 is assigned to the global x and line2 throws compilation error