WAP to enter 3 subject marks, display total, per 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();
}

WAP to enter 3 subject marks, display total, per and class. WAP to enter 3 subject marks, display total, per and class. Reviewed by Unknown on 21:27:00 Rating: 5

No comments:

Powered by Blogger.