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
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
What are the characteristics of arrays in c?
What is difference between arrays and pointers?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
Explain what is the benefit of using enum to declare a constant?
Why are all header files not declared in every c program?
Why are algorithms important in c program?
What is the difference between strcpy() and memcpy() function in c programming?
What is the use of a semicolon (;) at the end of every program statement?
What is the use of parallelize in spark?
When a c file is executed there are many files that are automatically opened what are they files?
How can a program be made to print the name of a source file where an error occurs?
Is main is a keyword in c?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
What is difference between class and structure?