#include <stdio.h>
int main()
{
char string1[20],string2[]="string literal";
int i;
printf("enter a string:");
scanf("%s",string1);
printf("string1 is:%s\nstring2 is:%s\n"
"string1 with spaces btw characters is:\n",
string1,string2);
for( i=0; string1 !='\0'; i++) <-- 1
printf("%c",string1); <-- 2+3
printf("\n");
return 0;
}
#include <stdio.h>
int main()
{
char string1[20],string2[]="string literal";
int i;
printf("enter a string:");
scanf("%s",string1);
printf("string1 is:%s\nstring2 is:%s\n"
"string1 with spaces btw characters is:\n",
string1,string2);
for( i=0; string1[i] !='\0'; i++)
printf("%c ",string1[i]);
printf("\n");
return 0;
}