#include int main() { int m,i,sum,num; i=0; sum=0; scanf(\"%d \",&m); while(i
This is because you have a space after your %d in the scanf lines.
%d
scanf
Change
scanf("%d ",&num);
To
scanf("%d",&num);
Scanf usually ignores whitespaces, so you don't want spaces in your format strings.
Scanf