+ 1

Can anyone help me with this question:-. Write a c++ program taking 5 item and defining it with any alphabet?

c++

2nd Jan 2018, 4:34 AM
Anshul Anand
Anshul Anand - avatar
26 Answers
+ 2
what do you mean by defining it with any alphabet??
2nd Jan 2018, 4:39 AM
Rishabh
Rishabh - avatar
+ 2
@anshul I will try wait means program must be like if you enter a it should give apple if b it should give ball like that NAA...
2nd Jan 2018, 4:43 AM
Rishabh
Rishabh - avatar
+ 2
with [9][9] you can save 9 letters of equal length 9 each ...means you can save 81 bits of character !!
2nd Jan 2018, 5:35 AM
Rishabh
Rishabh - avatar
+ 1
like if I press a it should show apple as outcome
2nd Jan 2018, 4:42 AM
Anshul Anand
Anshul Anand - avatar
+ 1
can you help plz
2nd Jan 2018, 4:42 AM
Anshul Anand
Anshul Anand - avatar
+ 1
ok... ok wait
2nd Jan 2018, 4:47 AM
Rishabh
Rishabh - avatar
+ 1
@luks complicated program trying my best!!
2nd Jan 2018, 5:10 AM
Rishabh
Rishabh - avatar
+ 1
ok
2nd Jan 2018, 5:10 AM
Anshul Anand
Anshul Anand - avatar
+ 1
you can share it on sololearn...if anyone can help it would be of get help to me
2nd Jan 2018, 5:12 AM
Anshul Anand
Anshul Anand - avatar
2nd Jan 2018, 5:23 AM
Elie Douaihy
Elie Douaihy - avatar
+ 1
thank you buddy ..you are a godsend
2nd Jan 2018, 5:23 AM
Anshul Anand
Anshul Anand - avatar
+ 1
ohh ty
2nd Jan 2018, 5:35 AM
Anshul Anand
Anshul Anand - avatar
2nd Jan 2018, 5:58 AM
Elie Douaihy
Elie Douaihy - avatar
+ 1
#include <iostream> using namespace std; int main() { char Word[9][9]={"Apple","Baby"};//Array char input; cin>>input; if (input=='a') { cout<<"a"; cout<<"\n"<<Word[0]; } else if (input=='b') { cout<<"b"; cout<<"\n"<<Word[1]; } else{ cout<<"Works With a and b"; } return 0; } //still in the code
2nd Jan 2018, 6:01 AM
Elie Douaihy
Elie Douaihy - avatar
0
like you have apple,oranges, graphes,kiwi and if you press a the outcome should be apple, if o it should be oranges
2nd Jan 2018, 4:45 AM
Anshul Anand
Anshul Anand - avatar
0
yes bro
2nd Jan 2018, 4:46 AM
Anshul Anand
Anshul Anand - avatar
0
ty..it must be very easy question but I am new to c++
2nd Jan 2018, 4:47 AM
Anshul Anand
Anshul Anand - avatar
0
@rishabh can you help me fast
2nd Jan 2018, 5:03 AM
Anshul Anand
Anshul Anand - avatar
0
why did you use [9][9] with word
2nd Jan 2018, 5:32 AM
Anshul Anand
Anshul Anand - avatar
0
Because its a char you need to extend it for longest words
2nd Jan 2018, 5:35 AM
Elie Douaihy
Elie Douaihy - avatar