11. Given a list of marks ranging from 0 to 100, write a program to compute grade?

Posted: August 26, 2012 in CSE Sem1, Lab 6
#include <stdio.h>
int  main()
{
int num;
printf("Enter your mark: ");
scanf("%d",&num);
if(num >80&&num<=100)
		{
printf(" You got A grade"); 
}
else if ( num >60&&num<=80)
		{ 
printf(" You got B grade");
}
else if ( num >40&&num<=60)
		{
printf(" You got C grade");
}

else if ( num < 40)
		{
printf(" You Failed in this exam");
}
return 0;
}
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