Chapter - 3: The Decision Control

If the ages of Ram, Shyam and Ajay are input through the keyboard, write a program to determine the youngest of the three.


C
Sections
6
Exercises

A

B

C

D

E

F

G

H

I

J

K

1

2

3

4

5

6

7

8

9

10

11

12

#include<stdio.h>
#include<conio.h>
int main()
{
	int ram,sam,ajy;
	
	printf("Enter the age of Ram, Shyam and Ajay respectively : ");
	scanf("%d%d%d", &ram,&sam,&ajy);
	
	if(ram<sam && ram<ajy)
		printf("\n\nRam is youngest among all.");
	else if(sam<ram && sam<ajy)
		printf("\n\nShyam is youngest among all.");
	else
		printf("\n\nAjay is youngest among all.");
		
	getch();
	return 0;
}

© 2020 Garbage Valuegarbage value logo