Computer Science, asked by triptichoubey1179, 1 year ago

Write a programvto enter two name and age of an employee by taking input from the user

Answers

Answered by dikshaverma4you
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();
}

Haezel: Keep it up!
dikshaverma4you: Sure ma'am :)
Similar questions