Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How do i make multipule answers for one thing

0 votes
asked Feb 22, 2020 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, 2020 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, 2020 by Ivana Ogunlaja (640 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.
...