This is my code in C :
#include<stdio.h>
int main()
{
printf("hello","world");
}
When I run this code in my system it showed only hello as output.Why is it not showing hello world as output ? What is the significance of usage of , between hello and world ? Can anyone please explain this to me ?
Thanks in advance.
You are calling
printfwith two arguments. The significance of the comma in that statement is that it is used to separate the two arguments.The first argument to
printfis a format string that can contain placeholders. The remaining arguments are the values that will be substituted into the format string instead of placeholders. But your format string has no placeholders, so the second argument is not used.This would work though: