fork(1) download
  1. #include <stdio.h>
  2. int main(){
  3. int marks[3],i,n,sum=0;
  4. printf("Enter number of students: ");
  5. scanf("%d",&n);
  6. for(i=0;i<n;++i){
  7. printf("Enter marks of student%d: ",i+1);
  8. scanf("%d",&marks[i]);
  9. sum+=marks[i];
  10. }
  11. printf("Sum= %d",sum);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 2164KB
stdin
3
stdout
Enter number of students: Enter marks of student1: Enter marks of student2: Enter marks of student3: Sum= 269033017