0% found this document useful (0 votes)
40 views1 page

Sample

The document contains 5 programming questions related to operators, precedence, increment/decrement operators, logical expressions and conditional statements. The questions cover concepts like equality, assignment, logical, unary and ternary operators.

Uploaded by

Kamaru Zaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views1 page

Sample

The document contains 5 programming questions related to operators, precedence, increment/decrement operators, logical expressions and conditional statements. The questions cover concepts like equality, assignment, logical, unary and ternary operators.

Uploaded by

Kamaru Zaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Sample Questions

1) Which of the following is different from others?


a) =
b) = =
c) +=
d) *=

2) What will be the output of the following code?


#include<stdio.h>
void main(){
int x = -1;
int y=x++ && ++x || x--;
printf(“%d %d”,x,y);
}

3) What will the following program print?


#include<stdio.h>
void main(){
char a='B';
int b=a+'2';
printf(“%c”,b);
}

4) Which of the following statements is false?


a) && operator is used to combine logical expressions
b) Value of a logical expression can be true or false
c) Among all the standard operators, unary operators have the highest precedence
d) None of the above

5) What will be the output of the following code?


#include <stdio.h>
void main(){
int a = 4, b=5, c, d;
c=(a++==b)?++a:b--;
d=--c?a<=b++ && c++>=--b:a--;
printf("%d %d %d %d",a,b,c,d);
}

You might also like