Sunday, October 3, 2010

write a program for AND Operator to getting the your % in c-programing ?

#include
#include


void main()
{
int a,b,c,d,e,f;
clrscr();
printf("\n\t Enter the marks of 1st subject\t\t:\t");
scanf("%d",&a);
printf("\n\t Enter the marks of 2nd  subject\t:\t");
scanf("%d",&b);
printf("\n\t Enter the marks of 3rd  subject\t:\t");
scanf("%d",&c);
printf("\n\t Enter the marks of 4th subject\t\t:\t");
scanf("%d",&d);
printf("\n\t Enter the marks of 5th subject\t\t:\t");
scanf("%d",&e);


f=(a+b+c+d+e)/5;


if(f>=60)
printf("\n\t\t\t Your are pass\n\n\t\t First Division\t\t:\t%d",f);
if((f>=50)&&(f<60))
printf("\n\t\t\t Your are pass\n\n\t\t Second Division\t\t:\t%d",f);
if((f>40)&&(f<50))
printf("\n\t\t\t Your are pass\n\n\t\t Third Division\t\t:\%dt",f);
if(f<40)
printf("\n\t\t\t Your are fail\n\n\t\t Fourth Division\t\t:\t%d",f);


getch();
}

No comments: