this is my program.
Code:
#include<stdio.h>
#include<conio.h>
struct abc
{
char name[20];
int day;
char month[10];
int year;
float salary;
};
void main()
{
struct abc person[10];
//float totalsalary=0;
int n,i,t;
char month[12];
clrscr();
printf("enter number of employees\n");
scanf("%d",&n);
printf("number of employee =%d\n",n);
for(i=0;i<=n;i++)
{
printf("input values\n");
scanf("%s %d %s %d %f",person[i].name,&person[i].day,person[i].month,&person[i].year,&person[i].salary);
// printf("%s %d %s %d %f\n",person[i].name,person[i].day,person[i].month,person[i].year,person[i].salary);
}
/*
printf("enter the month for totalsalary");
scanf("%s",month);
for(i=0;i<=n;i++)
{
t=strcmp(person[i].month,month);
if(t==0){
totalsalary=totalsalary+person[i].salary;
}
}
printf("the totalsalary for giving moth = %f",totalsalary); */
getch();
}
enter number of employees
2
number of employee =2
input values
Test 23 january 2012 6700 //Enter pressed
Now It goes back to turbo c++ editor
what I'm doing wrong ?