Q. Which of the following function is used for sets the position to the beginning of the file

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

Q. What will be the output of the following arithmetic expression ?

Code:
5+3*2%10-8*6
  • (A) -37
  • (B) -42
  • (C) -32
  • (D) -28
πŸ’¬ Discuss
βœ… Correct Answer: (A) -37

Q. What will be the output of the following statement ?

Code:
int a=10; printf(“%d &i”,a,10);
  • (A) 10
  • (B) 10 10
  • (C) error
  • (D) none of these
πŸ’¬ Discuss
βœ… Correct Answer: (D) none of these

Q. What will be the output of the following statement ?

Code:
printf(“%X%x%ci%x”,11,10,’s’,12);
  • (A) basc
  • (B) Bas94c
  • (C) error
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) basc

Q. What will be the output of the following statements ?

Code:
int a = 4, b = 7,c; c = a = = b; printf(“%i”,C.;
  • (A) 0
  • (B) 1
  • (C) error
  • (D) garbage value
πŸ’¬ Discuss
βœ… Correct Answer: (A) 0

Q. What will be the output of the following statements ?

Code:
int a = 5, b = 2, c = 10, i = a>b
void main()
{ printf(“hello”); main(); }
  • (A) 1
  • (B) 2
  • (C) infinite number of times
  • (D) none of these
πŸ’¬ Discuss
βœ… Correct Answer: (C) infinite number of times

Q. What will be output if you will compile and execute 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 5
  • (B) 2 -6 1
  • (C) 2 2 1
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 2 2 1

Q. What will be the output of the following statements ?

Code:
int x[4] = {1,2,3}; printf(“%d %d %D”,x[3],x[2],x[1]);
  • (A) 321
  • (B) 032
  • (C) 000
  • (D) 03%D
πŸ’¬ Discuss
βœ… Correct Answer: (B) 032

Q. What will be the output of the following statement ?

Code:
printf( 3 + “goodbye”);
  • (A) odbye
  • (B) dbye
  • (C) bye
  • (D) goodbye
πŸ’¬ Discuss
βœ… Correct Answer: (B) dbye

Q. What will be the output of the following statements ?

Code:
long int a = scanf(“%ld%ld”,&a,&A.; printf(“%ld”,A.;
  • (A) 0
  • (B) 2
  • (C) error
  • (D) garbage value
πŸ’¬ Discuss
βœ… Correct Answer: (D) garbage value