Enter 3 subject marks, display total, persentage and class


void main()
{
 int n1,n2,n3,*no1,*no2,*no3,*t,*p;
 clrscr();

 printf("enter 3 no:");
 scanf("%d%d%d",&n1,&n2,&n3);

 no1=&n1;
 no2=&n2;
 no3=&n3;

 *t=*no1+*no2+*no3;
 *p=*t/3;
 printf("\ntot:%d",*t);
 printf("\nper:%d",*p);

 printf("\nclass:");
 if(*p>=70)
 {
  printf("disti");
 }
 else if(*p>=60)
 {
  printf("first");
 }
 else if(*p>=50)
 {
  printf("second");
 }
 else if(*p>=40)
 {
  printf("pass");
 }
 else
 {
  printf("fail");
 }
 getch();
}






Enter 3 subject marks, display total, persentage and class Enter 3 subject marks, display total, persentage and class Reviewed by Unknown on 7:45:00 PM Rating: 5

No comments:

Powered by Blogger.