Q. What will be output if you will compile and execute the following c code?

Code:
void main()
{
int i=0;
if(i==0){
i=((5,(i=3)),i=1);
printf(“%d”,i);
}
else
printf(“equal”);
}
  • (A) 1
  • (B) 3
  • (C) 5
  • (D) equal
πŸ’¬ Discuss
βœ… Correct Answer: (A) 1

Q. What will be output if you will compile and execute the following c code?

Code:
int extern x;
void main()
printf(“%d”,x);
x=2;
getch();
}
int x=23;
  • (A) 0
  • (B) 2
  • (C) 23
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 23

Q. What will be output of the following c code?

Code:
void main(){
int a,b;
a=1,3,15;
b=(2,4,6);
clrscr();
printf(“%d “,a+B.;
getch();
}
  • (A) 3
  • (B) 7
  • (C) 17
  • (D) 21
πŸ’¬ Discuss
βœ… Correct Answer: (B) 7

Q. What will be output of the following c code?

Code:
void main(){
static main;
int x;
x=call(main);
clrscr();
printf(“%d “,x);
getch();
}
int call(int address){
address++;
return address;
}
  • (A) 0
  • (B) 1
  • (C) Compiler error
  • (D) Garbage value
πŸ’¬ Discuss
βœ… Correct Answer: (B) 1

Q. What will be output of the following c code?

Code:
#include “string.h”
void main(){
clrscr();
printf(“%d %d”,sizeof(“string”),strlen(“string”));
getch();
}
  • (A) 6 6
  • (B) 7 7
  • (C) 7 6
  • (D) 6 7
πŸ’¬ Discuss
βœ… Correct Answer: (C) 7 6

Q. What will be output of the following c code?

Code:
void main(){
int huge*p=(int huge*)0XC0563331;
int huge*q=(int huge*)0xC2551341;
*p=200;
printf(“%d”,*q);
}
  • (A) 0
  • (B) 200
  • (C) null
  • (D) Garbage value
πŸ’¬ Discuss
βœ… Correct Answer: (B) 200

Q. What will be output of the following c code?

Code:
struct marks{
int p:3;
int c:3;
int m:2;
};
void main(){
struct marks s={2,-6,5};
printf(“%d %d %d”,s.p,s.c,s.m);
}
  • (A) 2 -6 1
  • (B) 2 2 1
  • (C) 2 -6 5
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 2 2 1

Q. Which of the following function gives the current position in the file

  • (A) putw()
  • (B) ftell()
  • (C) fseek()
  • (D) getw()
πŸ’¬ Discuss
βœ… Correct Answer: (B) ftell()

Q. Which one is a collection of one or more variables, possibly of different types, grouped together under a single name for convenient handling

  • (A) Pointer
  • (B) Matrix
  • (C) Array
  • (D) Structure
πŸ’¬ Discuss
βœ… Correct Answer: (D) Structure

Q. Which function converts a string of digits into its numeric equivalent

  • (A) atan()
  • (B) atoi()
  • (C) calloc()
  • (D) strcat()
πŸ’¬ Discuss
βœ… Correct Answer: (B) atoi()