How do i make multipule answers for one thing

0 votes
asked Feb 22 by Lerj (160 points)

Sorry for the bad wording of the question, Im not very litterate when it comes to coding.

#include <iostream>

#include <stdio.h>

using namespace std;

int main(){

string test;

cout<<"say ok"<<endl;

if (test=="ok","OK","Ok","oK")

{

cout<<"test complete"<<endl;

}

See so i dont know how to make it so i'd get the same outcome for the same word spelt different without making entirely different else statements. It always just defaults to only work for the last word put.

1 Answer

0 votes
answered Feb 22 by anonymous

#include <iostream>

#include <stdio.h>

using namespace std;

int main(){

string test;

cout<<"say ok"<<endl;

if (test=="ok","OK","Ok","oK")

{

cout<<"test complete"<<endl;

}

commented May 3 by Ivana Ogunlaja (610 points)
I copied it on C++ there is an error
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...