[ create a new paste ] login | about

Link: http://codepad.org/HdR4PLGG    [ raw code | output | fork ]

vikraman - C, pasted on Mar 3:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<stdio.h>
int main()
{
  struct student{
    int mark[5];
  }
  student std[5];
  int i,j;
  for(i=0;i<5;i++){
    printf("Enter marks of student no. %d\n",i+1);
    for(j=0;j<5;j++)
      scanf("%d",&std[i].mark[j]);
  }
  for(i=0;i<5;i++){
    printf("Total marks of student no. %d is ",i+1);
    sum=0;
    for(j=0;j<5;j++)
      sum+=std[i].mark[j];
    printf("%d\n",std[i].mark[j]);
    if(
  }


Output:
1
2
3
4
5
6
7
8
9
In function 'main':
Line 7: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
Line 7: error: 'std' undeclared (first use in this function)
Line 7: error: (Each undeclared identifier is reported only once
Line 7: error: for each function it appears in.)
Line 16: error: 'sum' undeclared (first use in this function)
Line 21: error: expected expression before '}' token
Line 21: error: expected expression before '}' token
Line 21: error: expected declaration or statement at end of input


Create a new paste based on this one


Comments: