LAB#7, Q#2, BS.SE(A)

4 views
Skip to first unread message

MUHAMMAD AHMAD NAWAZ UL GHANI

unread,
Dec 28, 2011, 9:12:03 AM12/28/11
to Learn C Language
#include<stdio.h>
#include<conio.h>
int main (void)
{
int s,d,f,g,h,y,j,k,o;
clrscr();
printf("Enter your marks : ");
scanf("%d",&s);
for(d=86;d<=100;d++){
if(s==d){
printf("\nYour grade is A");
}

}


for(f=76;f<=85;f++){
if(s==f){
printf("\nYour grade is A-");
}

}


for(g=66;g<=75;g++){
if(s==g){
printf("\nYour grade is B+");
}

}


for(h=56;h<=65;h++){
if(s==h){
printf("\nYour grade is B");
}

}


for(y=46;y<=55;y++){
if(s==y){
printf("\nYour grade is B-");
}

}


for(j=36;j<=45;j++){
if(s==j){
printf("\nYour grade is C+");
}

}


for(k=31;k<=35;k++){
if(s==k){
printf("\nYour grade is C-");
}

}


for(o=0;o<=30;o++){
if(s==o){
printf("\nYour grade is F");
}

}


getch();
return 0;

AHSAN YASIN

unread,
Dec 29, 2011, 1:41:50 AM12/29/11
to Learn C Language
Ur code, may be correct but its not the REQUIRED answer because u have
to use "user define function" in ur code but I appritiate u if u've
written it ur self

On Dec 28, 7:12 pm, MUHAMMAD AHMAD NAWAZ UL GHANI
Reply all
Reply to author
Forward
0 new messages