3. WAP to enter 6 subject marks and display total, per and class, class as per given following condition (per>=70 then distinction, per >=60 then first, per>=48 then second, per>=40 then pass otherwise fail or if student fail in any subject then class is fail)
Defination ::
Source Coide ::
void main()
{
char s[6];
int i,tot=0,per;
clrscr();
printf("enter 6 sub mark:");
for(i=0;i<=5;i++)
{
scanf("%d",&s[i]);
}
for(i=0;i<=5;i++)
{
tot=tot+s[i];
}
printf("\ntot=%d\n",tot);
per=tot/6;
if(s[0]>=40 && s[1]>=40 && s[2]>=40 && s[3]>=40 && s[4]>=40 && s[5]>=40)
{
if(per>=70)
{
printf("dist");
}
else if(per>=60)
{
printf("first");
}
else if(per>=48)
{
printf("second");
}
else if(per>=40)
{
printf("pass");
}
}
else
{
printf("fail");
}
getch();
}
1. WAP to enter 6 subject marks and
display total, per and class, class as per given following condition
(per>=70 then distinction, per >=60 then first, per>=48 then second,
per>=40 then pass otherwise fail or if student fail in any subject then
class is fail)
Source Coide ::
void main()
{
char s[6];
int i,tot=0,per;
clrscr();
printf("enter 6 sub mark:");
for(i=0;i<=5;i++)
{
scanf("%d",&s[i]);
}
for(i=0;i<=5;i++)
{
tot=tot+s[i];
}
printf("\ntot=%d\n",tot);
per=tot/6;
if(s[0]>=40 && s[1]>=40 && s[2]>=40 && s[3]>=40 && s[4]>=40 && s[5]>=40)
{
if(per>=70)
{
printf("dist");
}
else if(per>=60)
{
printf("first");
}
else if(per>=48)
{
printf("second");
}
else if(per>=40)
{
printf("pass");
}
}
else
{
printf("fail");
}
getch();
}
3. WAP to enter 6 subject marks and display total, per and class, class as per given following condition (per>=70 then distinction, per >=60 then first, per>=48 then second, per>=40 then pass otherwise fail or if student fail in any subject then class is fail)
Reviewed by Unknown
on
21:39
Rating:
No comments: