Question

Write a program that asks for the user’s first name and last name. Then prints it...

Write a program that asks for the user’s first name and last name. Then prints it out in a sentence (The sentence is: __first name__ __lastname__.)Please use  C program

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <stdio.h>

int main() {
    char first[100], last[100];
    printf("Enter first name: ");
    scanf("%s", first);
    printf("Enter last name: ");
    scanf("%s", last);

    printf("The sentence is: __%s__ __%s__.\n", first, last);
    return 0;
}
Add a comment
Know the answer?
Add Answer to:
Write a program that asks for the user’s first name and last name. Then prints it...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In Java write a program that asks user’s name, records it in memory, prints the number...

    In Java write a program that asks user’s name, records it in memory, prints the number of times it saw the name since it was last started and goes back to asking user’s name.

  • problem2.cpp Write a program vhich asks the user to enter their full name (First Ni ddle...

    problem2.cpp Write a program vhich asks the user to enter their full name (First Ni ddle Last, using getline()) and then ei ther either prints out their middle name, or prints "Error: no midd le name" if they entered a name vithout a middle name (1ess than tvo spaces). 6 8#include <iostream> 9 #include <string 18 using namespace std; 11

  • Use PYTHON3 to create a program that asks the user for their name, and then prints...

    Use PYTHON3 to create a program that asks the user for their name, and then prints their initials. You must create a function called getInitials() that takes the name string and prints out the initials. It must be case insensitive and the initials must be printed in upper case. The program must contain a main() and a function called getInitials(), implemented as described in the function header comment given below. (You should include this function header comment in your own...

  • Write a program in java that asks a user for a file name and prints the...

    Write a program in java that asks a user for a file name and prints the number of characters, words (separated by whitespace), and lines in that file. Then, it replaces each line of the file with its reverse. For example, if the file contains the following lines (Test1.txt): This is a test Hi there Output on the console: Number of characters: 22 Number of words: 6 Number of lines: 2 Data written to the file (Test1.txt): tset a si...

  • 2. Write a java program that asks you to enter your last name, your country of...

    2. Write a java program that asks you to enter your last name, your country of origin, your age, and your expected graduation year. After you enter them, write out each answer on a separate line. You must use Scanner to input the 4 fields, and println to output the 4 fields separately.

  • Greeter Write a function that takes in a person's name, and prints out a greeting. The...

    Greeter Write a function that takes in a person's name, and prints out a greeting. The greeting must be at least three lines, and the person's name must be in each line. example: Hello name How are you do name Nice to meet you name Use your function to greet at least three different people. Full Names Write a function that takes in a first name and a last name, and prints out a nicely formatted full name, in a...

  • Write a Python program that prints a name as shown in the image below. The program...

    Write a Python program that prints a name as shown in the image below. The program asks the user to enter a name and how many time the user wants to display the name.. You need two to input two integer values. First, for repeating name in a row. Second, for number of rows. In total, your program will have three inputs. Add three comment lines at start of the program, which shows program purpose, your name and date. Hint:...

  • need a program written in C++ that asks, with breaks, the user for their name (character...

    need a program written in C++ that asks, with breaks, the user for their name (character sequence) age (integer) gender (as a character) address (as a sentence) and then the program clears the inputs then prints the information to the user formating must has some aesthetical appeal

  • Write a program that asks the user for a negative number, then prints out the product...

    Write a program that asks the user for a negative number, then prints out the product of all the numbers from -1 to that number Enter a negative number: -6 720 (The answer is 720 because-1x-2x-3x-4x-5 x-6 720).

  • Write a program that separately prompts the user for a first name and last name and...

    Write a program that separately prompts the user for a first name and last name and outputs a string containing the following information, in order: a. First letter of the user's name. b. First five letters of the user's last name. c. A random two-digit integer You must construct the desired string ensuring all characters are lowercase; output the identification string accordingly. Assume the last name contains at least 5 characters. You must use the Random (java.util.Random) class to generate...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT