Practical B)Exercise2: If the ages of Ram, Shayam and Ajay are input through the keyboard, write a program to determine the youngest of three.

Posted: September 17, 2012 in CSE Sem1, ECE Sem1, Lab 10B, Lab 10B
#include<stdio.h>
#include<math.h>
void main()
{
int ajay,ram,shyam;
printf("enter the ages of ajay,ram,shyam");
scanf("%d%d%d",&ajay,&ram,&shyam);
if((ajay>ram)&&(shyam>ajay))
{
printf("\n the youngest of the three is ram");
}
if((ram>ajay)&&(shyam>ajay))
{
printf("\n the youngest of the three is ajay");
}
if((ram>shyam)&&(ajay>shyam))
{
printf("\n the youngest of the three is shyam");
}
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s