wouldn't it have been a lot simpler to have coded it with a loop
int i;
printf(\nThe Result is : ");
for(i = 0; i < 7; i++)
printf("%s ", var[i]);
>>whats wrong in my code.....
how did you declare and initialize array var ? Most likely the problem is uninitialized data.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
ummmm....
how can you giv print to a single variable var[i] with %s specifier???
Are you referring to the code I posted? I'm assuming var is an array of character arrays. It works because I used a loop that starts the variable i at 0 and increments it by one on each loop iteration. If you don't know about loops yet then you should read up on them.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343