WAP to accept rollno,course name & marks of a student &
display grade if total marks is above 200?
Answer Posted / rohit
#include<stdio.h>
#include<conio.h>
struct mix
{
int rollno,m1,m2,m3,total;
char cn;
};
void main()
{
mix s1;
printf("Enter roll no:");
scanf("%d",&s1.rollno);
printf("Enter course name:");
scanf("%s",s1.cn);
printf("Enter marks of 3 subjects out of 150:");
scanf("%d%d%d",&s1.m1,&s1.m2,&s1.m3);
s1.total=s1.m1+s1.m2+s1.m3;
if(s1.total>200)
{
printf("A grade");
}
getch();
}
| Is This Answer Correct ? | 23 Yes | 15 No |
Post New Answer View All Answers
How do I get a null pointer in my programs?
What are runtime error?
Can we change the value of constant variable in c?
Explain main function in c?
What is structure and union in c?
The statement, int(*x[]) () what does in indicate?
What is s or c?
What are nested functions in c?
Explain the use of keyword 'register' with respect to variables.
What is the basic structure of c?
How do I copy files?
What tq means in chat?
Who developed c language and when?
How was c created?
How can I write a function that takes a format string and a variable number of arguments?