C++ User input

PHOTO EMBED

Sat Dec 24 2022 05:28:41 GMT+0000 (Coordinated Universal Time)

Saved by @berasumit611 #c++

#include <iostream>
#include <string>
using namespace std;


int main() {

    string name = "India";
    char dollar = '$';
    float gdp = 2.2;
    int year = 2015;

    cout << "Enter country name:";
    getline(cin, name);

    cout << "Enter dollar symbol:";
    cin >> dollar;

    cout << "Enter GDP:";
    cin >> gdp;

    cout << "Enter year:";
    cin >> year;

    cout << "As economic reforms picked up the pace, " << name << "'s GDP grew five-fold to reach US" << dollar << gdp <<" trillion in " << year << " (as per IMF estimates).";

    return 0;
}
content_copyCOPY

https://github.com/Internshala-Online-Trainings/programming-with-c-and-cpp-v2/blob/master/m3-oops-fundamentals-using-cpp/m3-code challenges - solution/m3-t3-e4.cpp