#include <stdio.h> #define size 7 int i; int marks[7]; void GPAsystem(char gpa[7]); int main() {char GPA[7]={'A','B','b','C','c','D','F'}; char subject[]=" 3crdtsub1, 3crdtsub2, 3crdtsub3, 3crdtsub4, 2crdtsub1, 2crdtsub2, 2crdtsub3"; printf("%s\nInput numbers according to above sequence\n", subject); for(i=0;i<7;i++) { scanf("%d", &marks); } printf("\n%s\n", subject); for(i=0;i<7;i++) {printf("%10d" ,marks); } printf("\n"); GPAsystem(GPA); for(i=0;i<7;i++){ printf("%10c", GPA);} } void GPAsystem(char gpa[7]) { for(i=0;i<7;i++) {if (marks>90) {marks=gpa[0];} else if (80<marks<90) {marks=gpa[1];} else if (70<marks<80) {marks=gpa[2];} else if (60<marks<70) {marks=gpa[3];} else if (50<marks<60) {marks=gpa[4];} else if (40<marks<50) {marks=gpa[5];} else if (marks<40) {marks=gpa[6];} } }
Sir it dors not call funtion and GPA[7] is printed as it is..........
And sir i wrote GPAsystem(GPA, 7); to call funtion but it gives an error of " GPAsystem cnt have two arguements" but when I wrote GPAsystem(GPA); it does not give error............