How to create a program that you can enter inputs.
1.การรับ Input หลังจากรันโปรแกรม
#include <stdio.h>
#include <string.h>
int main(void) {
char name[50] = "";
char lastname[50] = "";
printf("Please enter your name\n");
scanf("%s",name );
printf("Please enter your lastname\n");
scanf("%s",lastname );
printf("your name is %s %s\n", name, lastname);
return 0;
}gcc myname.c -o myname
2.การรับ Input ขณะเรียก program
Last updated
Was this helpful?