Answer to Question #288336 in C for sania

Question #288336

There was a competition conducted by Presidency University to all first year students. Each team can have n numbers with minimum value of 4. When they play the game each will be given a credit of 10 or 15 or 18 points

There will be 10 games to be played by each student of that team. If a student gets 100 points at the end then that count will be not be considered and if more than 2 students gets 100 credits then they are disqualified from the team.

Mr. Varun and his team plays the game. At the end they want to know their credits and whether they have qualified or not. Generate a C application for the same.

 

1
Expert's answer
2022-01-18T02:06:54-0500
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
/*
	There was a competition conducted by Presidency University to all first year students. 
	Each team can have n numbers with minimum value of 4. When they play the game each will be given a credit of 10 or 15 or 18 points
	There will be 10 games to be played by each student of that team. 
	If a student gets 100 points at the end then that count will be not be considered 
	and if more than 2 students gets 100 credits then they are disqualified from the team.
	Mr. Varun and his team plays the game. At the end they want to know their credits 
	and whether they have qualified or not. Generate a C application for the same.
*/


#define MIN_SIZE	4
#define TEAM_SIZE	4
#define NO_OF_GAMES	10


int main()
{
	int Score[TEAM_SIZE];
	int a,b,c,SEED=1;
	for(a=0;a<TEAM_SIZE;a++) Score[a]=0;
	srand(SEED); 
    for(a=0;a<TEAM_SIZE;a++) 
	{
		for(b=0;b<NO_OF_GAMES;b++)
		{
			c=rand();
			if(c%10==0)	Score[a] = Score[a]+ 10;
			if(c%15==0)	Score[a] = Score[a] + 15;
			if(c%18==0)	Score[a] = Score[a] + 18;
		}
	}
    for(a=0;a<TEAM_SIZE;a++) 
    {
    	printf("\n\tTeam Member - %d Credit = %d",a+1,Score[a]);
	}
	return(0);	
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS