Skillrack Inlab Problem 9

Solutions for Skillrack CSE1001 Inlab 9

25-Oct-2016 to 12-Nov-2016

Total time : 20 mins

Challenges : 1

Question (Appreciate student)

A student in a class is appreciated based on the following factors :

Number of ‘S’ grade in the subjects learnt >=3

Percentage of attendance >=90

Participation in sports activity in a semester >=2

Appreciation is given as follows :

(i) ‘Excellent’ if all the three conditions are met

(ii) ‘Very Good’ if conditions (i) and (ii) are met

(iii) ‘Good’ if conditions (i) and (iii) are met

Given the number of ‘S’ grades, Attendance and participation in sports activity in a semester, write an algorithm and the subsequent ‘C’ program to output the appreciation of the student.

Input format

First line contains number of ‘S’ grade

Next line contains the percentage of Attendance of the student

Next line contains the number of participation in sports activity by the student in the current semester

Output Format

Print the appreciation of the student

Solution

#include < stdio.h >
int main()
{
	int g,p,n;
	scanf("%d%d%d",&g,&p,&n);
	if(g >= 3 && p >= 90 && n >= 2)
	printf("Excellent");
	else if(g >= 3 && p >= 90)
	printf("Very Good");
	else if(g >= 3 && n >= 2)
	printf("Good");
	return(0);
}

Input

INPUT :
3
92
1

Output

OUTPUT :
Very Good
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s