Cricket Score Management Mini Project PDF Free
Cricket Score Management Mini Project PDF Free
An Autonomous Institution
(Approved by AICTE, New Delhi – Affiliated to Anna University, Chennai)
COIMBATORE-10
Staff In-charge
Date:
1
Index
Page
Sl. No. Description
Number
2
If statement :
Structure :
3
Printf statement :
Scanf statement :
Increment operator :
4
For(i=0;i<n;i++)
Decrement operator :
For(i=0;i<n;i--)
Looping Statement in C :
5
Types of Loops:
while loop
for loop
do..while
While loop :
6
Syntax :
while(condition)
{
Statements;
......
Increment For loop:
do-while :
7
A do-while Loop in C is similar to a while loop, except that a do-
while loop is execute at least one time.
8
Nested loop :
String :
Strcmp() :
Goto :
9
PROGRAMING FOF CRICKET SCORE SHEET :
#include<stdio.h>
#include<conio.h>
#include <string.h>
struct cricket
{
char name [100];
char team_name[100];
int batting_average;
};
void main()
{
struct cricket player[200];
int i,n;
char ch,team[100];
printf("HOW MANY PLAYERS\n");
scanf("%d",&n);
for (i=0;i<n;i++)
{
printf("\n INPUT THE NAME OF THE PLAYER %d : ",i+1);
scanf("%s",player[i].name);
printf("\n INPUT THE TEAM NAME OF THE PLAYER %d :",i+1);
scanf("%s",player[i].team_name);
printf("\n INPUT THE BATTING AVERAGE OF THE PLAYER %d
:",i+1);
scanf("%d",&player[i].batting_average);
} printf("=============================================\
n"); printf(" PLAYER'S NAME
COUNTRY BATTING AVERAGE\n");
printf("=============================================\n");
for(i=0;i<=n;i++)
printf(" %20s %20s%d\n",player[i].name, player[i].team_name,
player[i].batting_average);
for(i=0;i<n;i++)
{
printf("\n INPUT THE NAME OF THE PLAYER %d : ",i+1);
scanf("%s",player[i].name);
printf("\n INPUT THE TEAM NAME OF THE PLAYER %d :",i+1);
scanf("%s",player[i].team_name);
printf("\n INPUT THE BATTING AVERAGE OF THE PLAYER %d
:",i+1);
10
scanf("%d",&player[i].batting_average);
printf("===================================================
=====\n");
printf(" PLAYER'S NAME COUNTRY BATTING
AVERAGE\n");
printf("===================================================
======\n");
for(i=0;i<=n;i++)
printf(" %20s %20s%d\n",player[i].name, player[i].team_name,
player[i].batting_ average);
for(i=0;i<n;i++)
{
printf("\n INPUT THE NAME OF THE PLAYER %d : ",i+1);
scanf("%s",player[i].name);
printf("\n INPUT THE TEAM NAME OF THE PLAYER %d :",i+1);
scanf("%s",player[i].team_name);
printf("\n INPUT THE BATTING AVERAGE OF THE PLAYER %d
:",i+1);
scanf("%d",&player[i].batting_average);
} printf("================================================\
n");
printf(" PLAYER'S NAME COUNTRY BATTING AVERAGE\n");
printf("==============================================\n");
for(i=0;i<=n;i++) printf("%20s%d\
n",player[i].name,player[i].team_name,player[i].batting_avera ge);
read:
printf("\n\n INPUT FOR WHICH TEAM YOU WANT TO LIST : ");
scanf("%s",team);
printf("\n %s \n",team);
printf("===========================================\n=");
printf(" PLAYER'S NAME BATTING AVERAGE \n");
printf("===========================================\n=");
for(i=0;i<=n;i++)
printf(“%20s%20s%d\n",player[i].name,player[i].team_name,player[i].batting_
average);
printf(" \n\n DO YOU WANT TO LIST ANY OTHER TEAM ? (Y/N) : ");
11
ch=getch();
if (ch == 'Y' || ch == 'y')
goto read;
getch();
}
OUITPUT :
PROGRAM OUTPUT IN PC :
12
13
14
FLOWCHART FOR PROGRAM :
15
16
17
ALGORITHM :
Step1:START
Step2:Declare structure cricket .
Name as string.
Team name as string .
Batting average as integer .
Step3:Declare i,n and team name
Step4:Print “how many players” and get the value
of ‘n’
Step5:Get the names, team names and the batting
averages
Step6:Print the names, team names and batting
averages
Step7:Form a team using the data
Step8:Print the team players and average
Step9:Stop
18
19
20
21