Write a programvto enter two name and age of an employee by taking input from the user
Answers
Answered by
2
Hey, I am writing a C++ program for your question. Hope it helps you.
Program is as under:-
#include<iostream.h>
#include<conio.h>
#include<process.h>
void main()
{
clrscr();
char y,n,choice,name[100];
int age;
A:
cout<<"Enter the name of the employee"<<endl;
cin>>name;
cout<<"Enter the age of the employee"<<endl;
cin>>age;
cout<<"The name of the employee is "<<name<<endl;
cout<<"The age of the employee is "<<age<<endl;
cout<<"Do you want to enter a new entry (y/n) ?"<<endl;
cin>>choice;
if(choice=='y')
{
goto A;
}
if(choice=='n')
{
exit(0);
}
getch();
}
Program is as under:-
#include<iostream.h>
#include<conio.h>
#include<process.h>
void main()
{
clrscr();
char y,n,choice,name[100];
int age;
A:
cout<<"Enter the name of the employee"<<endl;
cin>>name;
cout<<"Enter the age of the employee"<<endl;
cin>>age;
cout<<"The name of the employee is "<<name<<endl;
cout<<"The age of the employee is "<<age<<endl;
cout<<"Do you want to enter a new entry (y/n) ?"<<endl;
cin>>choice;
if(choice=='y')
{
goto A;
}
if(choice=='n')
{
exit(0);
}
getch();
}
Haezel:
Keep it up!
Similar questions
Math,
7 months ago
Math,
7 months ago
Geography,
1 year ago
Accountancy,
1 year ago
English,
1 year ago