0
Please help me. I am a bigginer. I want to take marks as input from user in this code. So How can I do this?
#include<stdio.h> int main() { int i; int total_marks[]={86,78,94,68,92,78,64,62,72,61,72,65,80,72,62,68,66,65,81,62,56,68,58,56,82,70,74,67,62,76,70,78,76,84,88,73,65,77,63}; int marks_count[101]; for(i=0;i<101;i++){ marks_count[i]=0; } for(i=0;i<40;i++){ marks_count[total_marks[i]]++;} for(i=50;i<=100;i++){ printf("Marks:%d Count %d\n",i,marks_count[i]); } return 0; }
4 Respuestas
+ 1
int total_marks[40];
for(int i=0; i <40; i++){
scanf("%d", &total_marks[i]);
}
+ 1
Thank you so much. Actually I couldn’t declare scanf function at array that time. Btw thank you again🤗
0
You can get user input with scanf for example
0
I know but here how can I use?