fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int number_of_students;
  6. printf("Enter number of students: ");
  7. scanf("%d",&number_of_students);
  8.  
  9. char student_name[number_of_students][50];
  10. int i,j;
  11.  
  12. for(i=0; i<number_of_students; i++)
  13. {
  14. printf("Student %d name: ",i);
  15. fflush(stdin);
  16. gets(student_name[i]);
  17. }
  18.  
  19. for(i=0; i<number_of_students; i++)
  20. {
  21. printf("Student %d name: ",i);
  22. puts(student_name[i]);
  23. }
  24.  
  25. int number_of_courses;
  26. printf("Enter number of courses: ");
  27. scanf("%d",&number_of_courses);
  28.  
  29. double marks[number_of_students][number_of_courses];
  30.  
  31. for(i=0;i<number_of_students;i++) {
  32. printf("Marks of %s: \n",student_name[i]);
  33. for(j=0;j<number_of_courses;j++) {
  34. printf("\t->Mark of course %d: ", j);
  35. scanf("%d",&marks[i][j]);
  36. }
  37. }
  38. for(i=0;i<number_of_students;i++) {
  39. printf("Marks of %s: \n",student_name[i]);
  40. for(j=0;j<number_of_courses;j++) {
  41. printf("\t->Mark of course %d: ", j);
  42. printf("%d\n",marks[i][j]);
  43. }
  44. }
  45. return 0;
  46. }
  47.  
Success #stdin #stdout 0.01s 5288KB
stdin
4
Sanzida
Tisa
Ety
Sifat
5
90
70
35
45
80
60
80
95
35
45
60
50
75
25
50
60
30
65
75
80
stdout
Enter number of students: Student 0 name: Student 1 name: Student 2 name: Student 3 name: Student 0 name: 
Student 1 name: Sanzida
Student 2 name: Tisa
Student 3 name: Ety
Enter number of courses: Marks of : 
Marks of Sanzida: 
Marks of Tisa: 
Marks of Ety: 
Marks of : 
Marks of Sanzida: 
Marks of Tisa: 
Marks of Ety: