+ 1
How can I use the data entered by the user and print it out?
For example int name; printf("Enter your name"); printf("%d", &name); printf("Hi****"); How can I include the name entered by the user and print it on the screen.
3 Answers
+ 3
#include <stdio.h>
int main()
{
char name[20]; //for storing string input
printf("Enter your name");
//use scanf function to read input
scanf("%s", name); //to read a string.
printf("Hi : ");
//use printf for output
printf("%s", name) ;
return 0;
}
/* Ej Isip
scanf ("%d", &n) ; for reading a integer into n
printf("%d", n) ;
*/
+ 1
Thanks bro. You're from India? India has some great minds
0
Yes. Am an Indian. Thank for the complement. . đ
You're welcome đ€