(a)
main( )
{
int a = 300,
b, c ;
if ( a >= 400 )
b = 300 ;
c = 200 ;
printf ( "\n%d %d", b, c ) ;
}
output
garbage-value 200
(b)
main( )
{
int a = 500,
b, c ;
if ( a >= 400 )
b = 300 ;
c = 200 ;
printf ( "\n%d %d", b, c ) ;
}
output
200 300
(c)
main( )
{
int x = 10, y = 20 ;
if ( x == y ) ;
printf ( "\n%d
%d", x, y ) ;
}
output
10 20
(d)
main( )
{
int x = 3, y = 5 ;
if ( x == 3 )
printf ( "\n%d",
x ) ;
else ;
printf ( "\n%d",
y ) ;
}
output
3
5
(e)
main( )
{
int x = 3 ;
float y = 3.0 ;
if ( x == y )
printf
( "\nx and y are equal" ) ;
else
printf
( "\nx and y are not equal" ) ;
}
output
x and y are equal
(g)
main( )
{
int k = 35 ;
printf ( "\n%d %d
%d", k == 35, k = 50, k > 40 ) ;
}
output
0 50 0
(h)
main( )
{
int i = 65 ;
char j = 'A' ;
if ( i == j )
printf ( “C is WOW” ) ;
else
printf( "C is a
headache" ) ;
}
output
C is WOW
(i)
main( )
{
int a = 5, b, c ;
b = a = 15 ;
c = a < 15 ;
printf ( "\na = %d
b = %d c = %d", a, b, c ) ;
}
output
a = 15 b = 15 c = 0
(j)
main( )
{
int x = 15 ;
printf ( "\n%d %d
%d", x != 15, x = 20, x < 30 ) ;
}
output
1 20 1