Pls someone should help with if i want declare a variable that is not a number. i.e a words. | SoloLearn: Learn to code for FREE!

-1

Pls someone should help with if i want declare a variable that is not a number. i.e a words.

1/23/2021 2:18:05 PM

abdulsamad adamu

7 Answers

New Answer

+3

abdulsamad adamu , here is a sample with int, string and char. char is only suited for a single character, not for words. include <iostream> using namespace std; int main() { int number; string name; char letter; cin >> number; cin >> name; cin >> letter; cout << number << endl; cout << name << endl; cout << letter << endl; return 0; }

+1

give some more info. what language is it? do you have an example problem?

0

It's English language. I want declared a word cloudy as a variable I used "char" is showing errors

0

sorry i meant coding language. python, c, java, what are you using?

0

0

you should edit the post tags to include that. i dont know c++ so i cant help sorry!

0

Thanks you very much