Write a program in C to get input as NAME and ADDRESS as str

Write a program in C++ to get input as NAME and ADDRESS as string, AGE as integer and show it on the screen.

Solution

Code Mentioned Below:-

# include < iostream >

using namespace std ;

int main ()

{

intro obj = new intro ();

cout <<\" Enter Name Here \";

cin >> bj . name ;

cout <<\" Enter Address Here \";

cin >> bj . address ;

cout <<\" Enter Age Here \";

cin >> obj . age ;

cout <<\" Name : \" << obj . name ;

cout <<\" Address : \" << obj . address ;

cout <<\"Age: \" << obj . age ;

}

public class intro

{

public String name ;

public String address ;

public int age ;

}

Write a program in C++ to get input as NAME and ADDRESS as string, AGE as integer and show it on the screen.SolutionCode Mentioned Below:- # include < iostre

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site