0% found this document useful (0 votes)
27 views

Grade Greatest Number

This C program takes in three integer values from the user and determines which number is the greatest. It prompts the user to enter three numbers, stores the input in three integer variables, and then compares the variables to print out which one has the largest value. If the first number is greater than the second and second is greater than third, it prints the first is largest. Otherwise it compares the other variables and prints the largest number.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Grade Greatest Number

This C program takes in three integer values from the user and determines which number is the greatest. It prompts the user to enter three numbers, stores the input in three integer variables, and then compares the variables to print out which one has the largest value. If the first number is greater than the second and second is greater than third, it prints the first is largest. Otherwise it compares the other variables and prints the largest number.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

GRADE

GREATEST NUMBER

#include<stdio.h>

#include<stdio.h>

int main(void)

int main(void)
{

{
int intVar=0;
printf("Input grade:");
scanf("%d", &intVar);
{
if(intVar>=90)
{
printf("A!!! :)");
}
else if(intVar>=80)
{
printf("B!!! :)");
}
else if(intVar>=70)
{
printf("C!!!");
}
else if(intVar>=60)
{
printf("D!!!");
}
else
{
printf("E!!! :(");
}
}
}

int intVar=0;
int intVar2, intVar3;
printf("Enter three numbers:");
scanf("%d %d %d", &intVar,&intVar2,
&intVar3);
{
if(intVar>intVar2&&intVar2>intVar3)
{
printf("%d is the largest
number!!!\n",intVar);
}
else if(intVar2>intVar3&&intVar3>intVar)
{
printf("%d is the largest
number!!!\n",intVar2);
}
else
{
printf("%d is the largest
number!!!\n",intVar3);
}
}

You might also like