Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Enhanced Interactive C++ Program for Greeting and Arithmetic Operations #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MeghanaKatraju31
Copy link

This Pull Request introduces an enhanced C++ program that includes user interaction, input validation, and arithmetic operations. The following features and improvements have been implemented:

Greeting Message: The program starts by printing "Hello, World!" to the console.
User Input for Name: Prompts the user to enter their name, allowing spaces in the input by using std::getline.
Personalized Greeting: Greets the user with their entered name.
Input Validation for Numbers: Asks the user for two integers, with validation to handle invalid inputs and prompt the user to enter correct values.
Arithmetic Operation: Computes the sum of the two entered integers.
Display Results: Outputs the result of the addition to the console.
Key Changes:

Input Handling: Improved user input handling by using std::getline for names and robust validation for numeric inputs.
Error Handling: Added loops to ensure the user inputs valid integers and handle incorrect inputs gracefully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant