# include<stdio.h>
# include<conio.h>
void main()
{
int s1[10],s2[10],s3[10],total[10],per[10],i;
char name[20],pid[10];
clrscr();
printf("==================== Marksheet ======================");
printf("\n\n\n");
for(i=0;i<3;i++)
{
printf("\n Enter your name:");
scanf("%s",name[i]);
printf("\n Enter your PID:");
scanf("%s",pid[i]);
printf("\n Enter your Subject1:");
scanf("%d",&s1[i]);
printf("\n Enter your Subject2:");
scanf("%d",&s2[i]);
printf("\n Enter your Subject3:");
scanf("%d",&s3[i]);
}
printf(" \n ===================== RESULT OF MARKSHEET =================");
for(i=0;i<3;i++)
{
printf("\n Your name is:%s",name[i]);
printf("\n Your PID is:%s",pid[i]);
printf("\n Your Subject1 marks is:%d",s1[i]);
printf("\n Your Subject2 marks is:%d",s2[i]);
printf("\n Your Subject3 marks is:%d",s3[i]);
printf("\n Your Total of Marks is:%d",s1[i]+s2[i]+s3[i]);
printf("\n Your Percentage is:%d",total[i]/3);
}
getch();
}
This bold code gives me null value....plz help me out of this
and also taking some null exception in char array of name & pid.....plz help me out.