Code
Output
VS Code
Run
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <stdio.h> /* C is compiled with gcc on the server, then run. scanf really waits for you — type your answer straight after the question and press Enter. */ int main(void) { char name[64]; printf("What is your name? "); scanf("%63s", name); printf("Muraho, %s!\n", name); int marks[4] = {82, 74, 91, 68}; int total = 0; for (int i = 0; i < 4; i++) { total += marks[i]; } printf("average: %.1f\n", total / 4.0); return 0; }
Output
Input prepared before running (optional)
Press Run to start your program.