34.9k views
5 votes
Write a program that converts a line of data containing three integers so that the data appears on three separate lines.

User Cruz
by
6.7k points

1 Answer

6 votes

Answer:

Following are the program in C language

#include <stdio.h>// 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("\\");// move the control to next line

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

printf("\\");// 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

Step-by-step 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.

User Jptsetung
by
6.6k points