USER'S CHOICE POST

Internet Download Manager free download for life time activated
Top 10 software you must have in your computer/laptop/tab with free download link

Earn upto Rs. 9,000 pm checking Emails. Join now! And get Rs. 99 Instantly!

ALL THE INFORMATION GIVEN IN THIS SITE IS ONLY FOR THE LEARNING PURPOSE. WE SHOULD ALWAYS USE THE GENUINE SOFTWARE! USE OF ANY INFORMATION GIVEN HERE IS SOLELY USERS' RESPONSIBILITY!


Saturday, 4 August 2012

FIND THE GRADE OF MARKS

Filled under: ,

 FIND THE GRADE OF MARKS

#include<stdio.h>
 #include<conio.h>
 int main()
{
  int p,c,m,sum;
  float avg;
  clrscr();
  printf("Enter marks in three subjects:");
  scanf("%d%d%d",&p,&c,&m);
  sum=p+c+m;
  avg=(float)sum/3;
  printf("marks obtained=%0.2f",avg);
  if(avg>90)
        printf("grade=o");
  else if(avg>80&&avg<90)
        printf("\ngrade=e");
  else if(avg>70&&avg<80)
         printf("\ngrade=a");
  else if(avg<70)
         printf("\ngrade=f");
printf("\nThank you!");
  getch();
  return 0;
}

OUPTPUT:
Enter marks in three subjects: 70  65  80
grade=a
Thank you!

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...


Try New Whatsapp+ latest for free with lots of new Emoticons :) , Latest Version
Download NOW