0

If i declare one data type and defined some value to it then can i use it with some other values also?

Snippet of what I am thinking:- int sum; cin >> sum; cout << "Here's your value" << sum; cin >> sum; cout << "Here's your another value" << sum; .............. Is this correct?

3rd Oct 2019, 4:59 AM
Rishikesh Prasad Sinha
Rishikesh Prasad Sinha - avatar
3 Answers
+ 3
yes, but the value from the first input will replaced by the second input.
3rd Oct 2019, 5:06 AM
Taste
Taste - avatar
+ 2
correct
3rd Oct 2019, 5:05 AM
Gordon
Gordon - avatar
+ 2
you can click the Try It Yourself make edits, and save and then your codes are in code playground. (fourth button with {} icon)
3rd Oct 2019, 5:06 AM
Gordon
Gordon - avatar