#Extremely new, need help.

20 messages · Page 1 of 1 (latest)

severe fulcrum
#
{

    char color[20];
    char pluralNoun[20];
    char celebrity[20];

    printf("Enter a color: ");
    scanf("&s", color);
    printf("Enter a plural noun: ");
    scanf("&s", pluralNoun);
    printf("Enter a celebrity: ");
    scanf("&s", celebrity);

    printf("Roses are %s\n", color);
    printf("%s are blue\n", pluralNoun);
    printf("I love %s\n", celebrity);


    return 0;
}
#

its supposed to ask for the color, then the plural noun, thhen the celebrity.

#

but it doesn't work, but in the video im watching it does

#

I am not sure why and would appreciate it if someone can explain

#

Result: ```Enter a color: Blue
Enter a plural noun: Enter a celebrity: Roses are
are blue
I love

Process returned 0 (0x0) execution time : 1.417 s
Press any key to continue.

#

its like its pushing enter for me when i didn't even give an input yet

prime sierra
#

I think you want to post in #1013104018739974194 instead

severe fulcrum
#

@prime sierra do you know the issue though?

#

its probably extremely basic

prime sierra
#

Im not very good with C

#

But arent you supposed to write %s in scanf?

severe fulcrum
#

no

#

he didnt either

#

mine is the exact same as his

#

but mine messes up

#

idk why

#

im so stupid
i didnt even notice
the whole time
i did & and not %
LOL

#

@prime sierra lol

prime sierra
#

It happens to the best of us 🙂