Berikut code untuk menginput 1 baris kalimat yang dipisah dengan spasi ke dalam suatu variabel.
#include<stdio.h>
int main ()
{
char string1[100];
// Input
scanf("%[^\n]s", string1);
// Output
printf("%s", string1);
}
Contoh input:
symbol 123456 abcde !@#$%^
Contoh output:
symbol 123456 abcde !@#$%^
No comments:
Post a Comment