Created
June 15, 2020 05:27
-
-
Save sivsivsree/bb6242fa1347ab3193af6e6b6e37a0d1 to your computer and use it in GitHub Desktop.
sample 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int students = 1; | |
void getMarks(int *s1, int *s2, int *s3, int *s4, int *s5){ | |
for(int i=0; i< students; i++) { | |
printf("student%d ", i+1); | |
printf("\nenter s1 mark: "); | |
scanf("%d", &s1[i]); | |
printf("\nenter s2 mark: "); | |
scanf("%d", &s2[i]); | |
printf("\nenter s3 mark: "); | |
scanf("%d", &s3[i]); | |
printf("\nenter s4 mark: "); | |
scanf("%d", &s4[i]); | |
printf("\nenter s5 mark: "); | |
scanf("%d", &s5[i]); | |
} | |
} | |
void printMarks(int *s1, int *s2, int *s3, int *s4, int *s5){ | |
printf("\n Rank List "); | |
for(int i=0; i< students; i++) { | |
int sum = s1[i] + s2[i] + s3[i] + s4[i] + s5[i]; | |
printf("s1=%d s2=%d s3=%d s4=%d s5=%d toalsum=%d", s1[i], s2[i], s3[i], s4[i], s5[i], sum); | |
} | |
} | |
int main(void) { | |
char name[10][10]; | |
int s1[10],s2[10],s3[10],s4[10],s5[10]; | |
getMarks( s1, s2, s3, s4, s5); | |
printMarks( s1, s2, s3, s4, s5); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment