/*Write a program to take color,model and price of a car and display it. use struture to do the task.*/
#include<iostream>
using namespace std;
struct car{
char color[20];
char model[20];
int price;
void input(){
cout<<"Enter Color, model and Price of Car:"; cin>>color>>model>>price;
}
void output(){
cout<<"Color:"<<color<<endl;
cout<<"Model:"<<model<<endl;
cout<<"price:"<<price<<endl;
}
};
int main(){
car c;
c.input();
c.output();
}

0 Comments had been done yet:
Post a Comment