+ 1

Topic not question subject of statements in cpp

From I read somewhere else Compound statements Are a set of statements enclosed within two braces {} which is also called scope And they are useful in two ways 1 allow programer to put multiple statements where only statement is allowed 2 with scope the variables inside it remain defined in other side of the program they aren’t known Scope example { int min , i=10, j=20; min=(i<j?i:j); cout<<min; }

11th Jul 2020, 1:37 PM
Elaph Alabasy
Elaph Alabasy - avatar
1 Réponse
0
Variable declared within braces have local scope of within.. Outside of that block is undefined.
11th Jul 2020, 2:08 PM
Jayakrishna 🇮🇳