26.09.2017, 12:25
This is the code:
Now after I compile and run, it asks for the name and only the first marks for computer and after that, it just prints out others in one line then closes
Код:
#include <stdio.h> #include <conio.h> main () { float a, b, c, d, e, total; total = a + b + c + d + e; char mark[50] = "marks obtained in"; char str[30] = "\t MARKSHEET"; char name[30]; printf("Enter name: "); scanf("%s", name); // getting marks from the user // printf("%s Computer: ", mark, a); scanf("%.2f", &a); printf("%s Physics: ", mark, b); scanf("%.2f", &b); printf("%s English: ", mark, c); scanf("%.2f", &c); printf("%s Urdu: ", mark, d); scanf("%.2f", &d); printf("%s Maths: ", mark, e); scanf("%.2f", &e); }