Ask Question

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

+3
Answers (1)
  1. 21 January, 21:48
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers