The C program below does not throw an error but does not work either, and gives garbage value. Please tell me why?
I am using Codeblock editors.The program runs fine when I do not use the array in the program.But I have thoroughly read it and I didn't find any mistake.
#include<stdio.h>
int main(){
char name1[27];
int maths;
int physics;
int Cs;
int bio;
int english;
int urdu;
int ps;
int isl;
printf("What is your name : ");
scanf(" %s",name1);
printf("\n\nwhat is your score in Mathematics : ");
scanf(" %d",&maths);
printf("\n\nwhat is your score in physics : ");
scanf(" %d",&physics);
printf("\n\nwhat is your score in computer science : ");
scanf(" %d",&Cs);
printf("\n\nwhat is your score in biology : ");
scanf(" %d",&bio);
printf("\n\nwhat is your score in English : ");
scanf(" %d",&english);
printf("\n\nwhat is your score in Urdu : ");
scanf(" %d",&urdu);
printf("\n\nwhat is your score in Pakistan study : ");
scanf(" %d",&ps);
printf("\n\nwhat is your score in Islamiat : ");
scanf(" %d",&isl);
printf("\n****************************************************************************************");
printf("\nName Mathematics Physics Com.sc Biology English Urdu Pak-Study Islamiat");
printf("\n****************************************************************************************");
printf("\n%-16s%-15d%-11d%-10d%-11d%-11d%-8d%-13d%0d",name1,maths,physics,Cs,bio,english,urdu,ps,isl);
return (0);
}