+ 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.

9th Dec 2021, 2:32 PM
Ej Isip
Ej Isip - avatar
3 Respuestas
+ 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) ; */
9th Dec 2021, 2:42 PM
Jayakrishna 🇮🇳
+ 1
Thanks bro. You're from India? India has some great minds
10th Dec 2021, 12:31 AM
Ej Isip
Ej Isip - avatar
0
Yes. Am an Indian. Thank for the complement. . 🙏 You're welcome 🤝
10th Dec 2021, 6:43 PM
Jayakrishna 🇮🇳