How do I declare a variable in a scope?

+2 votes
asked Jan 7, 2018 by timothy johnsonII (140 points)
#include <iostream>

#include <string>

#include <vector>

#include <fstream>

using namespce std;

in main () {

              variable = (condition)? true : false

              int  largestNum = ( 5 . 2 ) ? 5 :  2;

              return 0;

}

1 Answer

0 votes
answered Jan 11, 2018 by anonymous

"variable = (condition)? true : false" this is syntax.

And below is example of it. Where "largestNum" is variable declared of "int" type.

int  largestNum = ( 5 . 2 ) ? 5 :  2;

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.
...