Not a member of gistpad yet?
Sign Up,
it unlocks many cool features!
- // SpiderX Code
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int age;
- string fullName;
- // 1. Pehle hum number input lete hain
- cout << "Enter Age: ";
- cin >> age;
- // YAHAN HAI MAGIC LINE
- // cin buffer mein se 'Enter' (\n) ko hatane ke liye
- cin.ignore();
- // 2. Ab hum string input lete hain (jo space ke sath ho sakti hai)
- cout << "Enter Full Name: ";
- getline(cin, fullName);
- // Show Output
- cout << "\n--- Result ---" << endl;
- cout << "Age: " << age << endl;
- cout << "Name: " << fullName << endl;
- return 0;
- }
RAW Gist Data
Copied
