# In an inter-college competition, various sports and games are played between different colleges like cricket, basketball, football, hockey, lawn tennis, table tennis, carom, and chess. The information regarding the games won by a particular college is stored in bit numbers 0, 1, 2, 3, 4, 5, 6, 7 and 8 respectively of an integer variable called the game. The college that wins in 5 or more than 5 games is awarded the Champion of Champions trophy. If a number is entered through the keyboard, then write a program to find out whether the college won the Champion of the Champions Trophy or not, along with the names of the games won by the college.

A
Sections
3
Exercises
``````#include<stdio.h>
#include<conio.h>
#include<windows.h>
#include<math.h>

#define _BV(x) 1<<x

int bintodec(int*);
void initinfo(int*);

int main()
{
int game, i, count = 0;
for (i = 0; i <= 8; i++)
{
count++;
}
if (count >= 5)
printf("\nYou are eligible for champions trophy.\n");
else
printf("\nYou aren't eligible for champions trophy.\n");
_getch();
return 0;
}

int bintodec(int *num)
{
int i, dec = 0;
for (i = 0; i <= 8; i++)
dec += num[i] * (int)pow(2, 8 - i);
return dec;
}

void initinfo(int *information)
{
int i;
for (i = 0; i <= 8; i++)
information[i] = 0;
}

{
int info[9], i;
printf("3. Football\n4.Hockey\n");
printf("5.Lawn Tennis\n6.Table Tennis\n");
printf("\nEnter the number of winning of games.");
printf("Answer given should be in the form of 0 or 1.");
printf("And should be given\n one by one for each game.\n");
for (i = 0; i <= 8; i++)
scanf("%d", &info[i]);
*game = bintodec(info);
}``````