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


Please Help Members By Posting Answers For Below Questions

What is the best style for code layout in c?

832


What is the size of empty structure in c?

810


What is the size of array float a(10)?

894


Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon

1986


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

2895


Can a pointer be static?

820


Which node is more powerful and can handle local information processing or graphics processing?

1072


Why void main is used in c?

780


Is c easier than java?

787


How can you restore a redirected standard stream?

791


What is the process of writing the null pointer?

784


What is c system32 taskhostw exe?

786


What are the types of functions in c?

751


How to get string length of given string in c?

800


How can I change the size of the dynamically allocated array?

889