79639669

Date: 2025-05-26 23:45:59
Score: 0.5
Natty:
Report link

#include <iostream>

#include <string>

int main() {

std::string name;

int num1, num2;

// Ask for the user's name

std::cout \<\< "Enter your name: ";

std::getline(std::cin, name);

// Greet the user

std::cout \<\< "Hello, " \<\< name \<\< "!" \<\< std::endl;

// Ask for two numbers

std::cout \<\< "Enter the first number: ";

std::cin \>\> num1;

std::cout \<\< "Enter the second number: ";

std::cin \>\> num2;

// Add and display result

int sum = num1 + num2;

std::cout \<\< "The sum of the two numbers is: " \<\< sum \<\< std::endl;

return 0;

}

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: user30643232