c-record - 3) if else.... ladder
#include<stdio.h>
#include<conio.h>
void main()
{
int x;
char n[10];
clrscr();
printf("\nenter the Name : ");
scanf("%s",&n);
printf("\nenter the marks: ");
scanf("%d",&x);
{
if (x>80 && x <= 100)
{
printf("\nGrade is A");
} else
if (x>60 && x <= 80)
{
printf("\nGrade is B");
} else
if (x>40 && x <= 60)
{
printf("\nGrade is C");
} else
{
printf("\n--Fail--");
}
}
getch();
}
note:- write three outputs
1) output:-
alt +f9 ------ run and
ctrl+f9 ------ compile
2) output:-
alt +f9 ------ run and
ctrl+f9 ------ compile
3) output:-
alt +f9 ------ run and
ctrl+f9 ------ compile
Comments
Post a Comment