Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Funny Pictures MCA Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter




C Program for grade which is based on the marks


Posted Date: 24 Mar 2008    Resource Type: Articles/Knowledge Sharing    Category: Computer & Technology

Posted By: ashish singh       Member Level: Diamond
Rating:     Points: 2



/*Program to accept name , class and marks with the use of structure
with pointer. Also print the grade which is based on the marks-
1. marks > = 75 grade-A
2. marks >=50 and < 75 grade-B
3. marks < 50 grade-C
*/
#include

main ( )
{
struct {
char name[20];
int class;
int marks;
}*ptr;
printf ( "Name:" );
scanf ( " %s", ptr->name );
printf ( "Class:" );
scanf ( " %d",&ptr->class );
printf ( " Marks:" );
scanf ( " %d", &ptr->marks );
printf ( "Name\tClass\tMarks\tGrade\n" );
printf ( " %s\t" , ptr->name );
printf (" %d\t" , ptr->class );
printf ( " %d\t" , ptr->marks );
if ( ptr->marks < 50 )
printf ( " F\n" );
else
if ( ptr->marks >=50 && ptr->marks < 75 )
printf ( " B\n" );
else
printf ( " A\n" );
}




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: C Program to understand pointer to structure
Previous Resource: C Program to accept name , class and marks of 10 students with the use
Return to Discussion Resource Index
Post New Resource
Category: Computer & Technology


Post resources and earn money!
 
Related Resources

Watch TV Channels



Contact Us    Editors    Privacy Policy    Terms Of Use   

SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.