DEV Community

Elowosah 2
Elowosah 2

Posted on

Frist program

// Import the necessary libraries

include

include

// Use the standard namespace to avoid prefixing standard library elements
using namespace std;

// Define the main function, which is the entry point of the program
int main() {
// Declare variables to store the user's name and age
string name;
int age;

// Prompt the user to enter their name
cout << "Please enter your name: ";

// Read the user's input and store it in the 'name' variable
getline(cin, name);

// Prompt the user to enter their age
cout << "Please enter your age: ";

// Read the user's input and store it in the 'age' variable
cin >> age;

// Print out a greeting message with the user's name and age
cout << "Hello, " << name << "! You are " << age << " years old." << endl;

// Return an integer value to indicate the program's exit status
return 0;
Enter fullscreen mode Exit fullscreen mode

}

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more