ST ST
ST ST
2) main() (2)
{
int x=5,i=5;
printf(“%d%d%d%d%d%d”,i++,i--,++i,--i,i);
printf(“%d %d %d\n”,x,x<<2,x>>2);
}
3) main() (2)
{
int i=-1,j=-1,k=0,l=2,m;
m=i++ && j++ && k++ || l++;
printf(“%d %d %d %d %d”,i,j,k,l,m);
}
5) main() (1)
{
int i=-1;
+i;
printf(“i = %d, +i = %d \n”,i,+i);
}
6) main() (1)
{
int k=1;
printf(“%d==1 is %s”, k , k==1?“TRUE“:”FALSE”);
}
main() (1)
7)
{
int i=5;
printf(“%d”,i=++i ==6);
}
Q.2 (A) What do you mean by ternary operator? Write following code using [2]
ternary ? Operator.
if(a>10)
if(a<20)
cost=100;
else cost=150;
else cost=50;
(B) What is the difference between 32-bit and 64-bit operating system? [3]
Also give the difference between compiler and interpreter.
(C) W.A.P to read three numbers from the keyboard & find out minimum [5]
out of these three using if….else nested structure.
Q.3 (A) Why ‘C’ language is called middle level language? [2]
(B) Explain implicit and explicit type conversion using suitable examples. [3]
(C) W.A.P to read and display following table of data. The Name and Code [5]
must be left-justified and Price must be right justified.
Q.4 (A) Write a size & range of following data types on a 16-bit machine. [2]
1) signed char 2) unsigned short int 3) float 4) long double
(B) W.A.P to check entered character is vowel or not using switch case [3]
statement.
(C) W.A.P to read three numbers from the keyboard & find out [5]
maximum of these three using if….else nested structure.
(B) Explain implicit and explicit type conversion using suitable [3]
examples.
Q.4 (A) How enumeration variables are declared? What is the [2]
advantage of using them in a program?