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.
#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);
}
Comments
Leave a comment