printf("\nThe Result is : %s %s %s %s %s %s %s %s\n",var[0],var[1],var[2],var[3],var[4],var[5],var[6],var[7]);

while executing this i get correct result upto var[4]....
and for var[5] and var[6] im geting some garbage valuess, then for var[7] im getg my result...
whats wrong in my code.....

Without seeing more code, any chance those variables with the variables aren't strings? (ie ints, floats, doubles?) if so, you'll need to use the appropriate format specifier %d, %f, etc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.