APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY Previous Years Question Paper & Answer

Course : B.Tech

Semester : S1 and S2

Year : 2017

Term : DECEMBER

Branch : BIOTECHNOLOGY

Scheme : 2015 Full Time

Course Code : CS 100

Page:8





PDF Text (Beta):

scanf("%d%d%d" ,&a, &b,&c);

if(a>b)
{

if(a>c)
max=a;
else

max=c;

else

if(b>c)

max=b;
else
max=c;

}

printf ("Mmax=%d",max);

4.THE ELSE IF LADDER:

There is another way of putting 15 together when multipath decisions are involved. A multipath decision is a chain
of 'if's' in which the stmt associated with each else is an if. It takes the following general form.

if(cond1)
Stmt-1;

else if(cond2)
Stmt-2;

else if(cond3)
Stmt-3;

else if(condn)
Stmt-n;

else
Default stmt;

Stmt-x;

This construction is known as else if ladder.

Similar Question Papers