0
why this program is not work in %s and when I use %c it works .
Explain me please how this program works #include<stdio.h> int main() { char name[]="vikalp"; int i=0; while(name[i]){ printf("%s",name[i]); i++; } return 0; }
3 Respuestas
+ 3
Because name[i] give a character so if you want to print character you have to use %c, %s is use when we require to print string .
0
One more question I didn't give any. condition while using "while " loop
I just gives a value zero to i and then how loop decide where to stop because last character is also null character in short I want to ask how this name[ i ] works ,can you tell entire process please