+ 1
Can anyone help me with this question:-. Write a c++ program taking 5 item and defining it with any alphabet?
c++
26 Antworten
+ 2
what do you mean by defining it with any alphabet??
+ 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...
+ 2
with [9][9] you can save 9 letters of equal length 9 each ...means you can save 81 bits of character !!
+ 1
like if I press a it should show apple as outcome
+ 1
can you help plz
+ 1
ok... ok wait
+ 1
@luks complicated program trying my best!!
+ 1
ok
+ 1
you can share it on sololearn...if anyone can help it would be of get help to me
+ 1
Try This works with a and b
https://code.sololearn.com/caie98L1SN76/?ref=app
+ 1
thank you buddy ..you are a godsend
+ 1
ohh ty
+ 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
0
like you have apple,oranges, graphes,kiwi and if you press a the outcome should be apple, if o it should be oranges
0
yes bro
0
ty..it must be very easy question but I am new to c++
0
@rishabh can you help me fast
0
why did you use [9][9] with word
0
Because its a char you need to extend it for longest words