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

}

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more