C Program, asks for Name, Age...?

We need to make a program which when run, it will ask for the users Name, Age, Course, Year Lvl, Address, and Gender.

We're using Turbo Cplusplus IDE,

please correct my codes if im wrong, im just a student and a beginner in Cplusplus .

I first try to make an output like this just to test that my program will run,

Name:

Age:

using these codes

#include <iostream.h>

#include <conio.h>

int main()

{

clrscr();

char name[] ={"Name: "};

int age;

cout<< name <<endl;

cin>> name;

cout << "Age: " << age<<endl;

cin>> age;

getch();

}

but when i run it, the output only shows this:

Name:

the "Age: " did not appear,

how can i make the output we need to do, if i cant make the output i want to try first?

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 QUIZLS.COM - All rights reserved.