Ask Question
13 October, 06:34

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

+1
Answers (1)
  1. 13 October, 06:46
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers