Q.1

What will be the output of the program?

#include<stdio.h>
int main()
{
    char ch;
    ch = 'A';
    printf("The letter is");
    printf("%c", ch >= 'A' && ch <= 'Z' ? ch + 'a' - 'A':ch);
    printf("Now the letter is");
    printf("%c\n", ch >= 'A' && ch <= 'Z' ? ch : ch + 'a' - 'A');
    return}
  • The letter is a
    Now the letter is A
  • The letter is A
    Now the letter is a
  • Error
  • None of above
Q.2

What will be the output of the program?

#include<stdio.h>
int main()
{
    int i=    i = i++;
    printf("%d\n", i);
    return}
  • 3
  • 4
  • 5
  • 6
Q.3

What will be the output of the program?

#include<stdio.h>
int main()
{
    int x=y=z;
    z = x!=4 || y ==
    printf("z=%d\n", z);
    return
}
  • z=0
  • z=1
  • z=4
  • z=2
Q.4

Associativity of an operator is either Left to Right or Right to Left.

  • True
  • False
Q.5

Every operator has an Associativity

  • Yes
  • No
Q.6

Which of the following are unary operators in C?

1. !
2. sizeof
3. ~
4. &&
  • 1, 2
  • 1, 3
  • 2, 4
  • 1, 2, 3
Q.7

What will be the output of the program?

#include<stdio.h>
int main()
{
    int i=
    int j = i + (5);
    printf("%d\n", j);
    return
}
  • 4
  • 7
  • 6
  • 5
Q.8

What will be the output of the program?

#include<stdio.h>
int main()
{
    int a=b=c;
    c = (a ==|| b > 200);
    printf("c=%d\n", c);
    return
}
  • c=100
  • c=200
  • c=1
  • c=300
Q.9

What will be the output of the program?

#include<stdio.h>
int main()
{
    static int a[20];
    int i =    a[i] = i  ;
    printf("%d, %d, %d\n", a[0], a[1], i);
    return}
  • 1, 0, 1
  • 1, 1, 1
  • 0, 0, 0
  • 0, 1, 0
0 h : 0 m : 1 s