+ 2
Write a c program that allows you to enter and display your first name
4 ответов
+ 3
int main( )
{
char yourname;
printf(“whats your name?\t");
scanf("%c",&yourname);
getch();
return (0);
}
+ 3
Joshua Mong
Char takes only one character. So you need to use pointer to take string input.
+ 2
Can you show us your attempt? At which point do you get stuck?
+ 2
char yourname[50]; // so you can input a name with max 50 letters
then it needs to be %s
And there seems to be a strange quotation mark in printf