int main()
{
char nama[20];
printf("nama anda : ");
scanf("%s", nama);
printf("selamat sore mr.%s\n",nama);
return 0;
}
#include
int main()
{
char nama[50];
int i =0;
printf("nama anda : ");
do
{
scanf("%c", &nama[i]);
i++;
}while (nama[i-1] != '\n' );
nama[i]='\0';
printf("selamat sore mr.%s\n",nama);
printf("nama anda terdiri dari %d kata\n", i);
return 0;
}
No comments:
Post a Comment