I am very new to c/c++ programming. i was writing a few lines of code and after compiling and running the program i did not receive the desired output. can you please help me in this matter.
/* Test.c */
#include <stdio.h>
main()
{
char i[30];
clrscr();
printf("Enter a name: ",i);
scanf("%s",i);
printf("The name is %s",i);
}
When I run the above program It prompts me to enter the name.
If I enter:
Debashish
(Debashish is my name).
it will display:
The name is Debashish
But if I enter:
Debashish Gupta
(My Full Name)
It will display Debashish and not Debashish Gupta.
Can anyone please tell me where am i wrong.