Ask Question
24 December, 04:07

Write some code that reads a value into the variable name then prints the message "Greetings, NAME" on a line by itself, where NAME is replaced the value that was read into name. For example, if your code read in "Rachel" it would print out "Greetings, Rachel" on a line by itself.

+4
Answers (1)
  1. 24 December, 07:44
    0
    Following are the code in the c language

    #include / / header file

    int main () / / main method

    {

    char name[90]; / / variable name

    printf ("enter name:");

    gets (name); / / read name

    printf ("Greetings,"); / / display message Greetings,

    printf ("%s/n", name); / / display name

    return 0;

    }

    Output:

    Greetings, Rachel

    Explanation:

    Following are the description of code in C language.

    Read the input by using gets (). The gets () method is used for taking the input as a string. Print the message by using printf (). It will display the Greetings, Rachel in the console.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write some code that reads a value into the variable name then prints the message "Greetings, NAME" on a line by itself, where NAME is ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers