Ask Question
3 March, 06:27

Write a program that converts a line of data containing three integers so that the data appears on three separate lines.

+5
Answers (1)
  1. 3 March, 08:12
    0
    Following are the program in C language

    #include / / header file

    int main () / / main function

    {

    int x1, y1, z1; / / variable declaration

    printf (" Enter the three number : ");

    scanf ("%d%d%d",&x1,&y1,&z1); / / input the three number by user

    printf (" Number 1:%d", x1); / / dispaly number 2

    printf ("/n"); / / move the control to next line

    printf (" Number 2:%d", y1); / / dispaly number 2

    printf ("/n"); / / move the control to next line

    printf (" Number 3:%d", z1); / / dispaly number 3

    return 0;

    }

    Output:

    Enter the three number : 12 23 45

    Number 1: 12

    Number 2: 23

    Number 3: 45

    Explanation:

    In this program we have declared three variable x1, y1, z1 of type int. After that we take the input from user by using scanf function and finally printed the value on the three separate lines.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a program that converts a line of data containing three integers so that the data appears on three separate lines. ...” 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