{ "@context": "https://schema.org", "@type": "Organization", "name": "Brainscape", "url": "https://www.brainscape.com/", "logo": "https://www.brainscape.com/pks/images/cms/public-views/shared/Brainscape-logo-c4e172b280b4616f7fda.svg", "sameAs": [ "https://www.facebook.com/Brainscape", "https://x.com/brainscape", "https://www.linkedin.com/company/brainscape", "https://www.instagram.com/brainscape/", "https://www.tiktok.com/@brainscapeu", "https://www.pinterest.com/brainscape/", "https://www.youtube.com/@BrainscapeNY" ], "contactPoint": { "@type": "ContactPoint", "telephone": "(929) 334-4005", "contactType": "customer service", "availableLanguage": ["English"] }, "founder": { "@type": "Person", "name": "Andrew Cohen" }, "description": "Brainscape’s spaced repetition system is proven to DOUBLE learning results! Find, make, and study flashcards online or in our mobile app. Serious learners only.", "address": { "@type": "PostalAddress", "streetAddress": "159 W 25th St, Ste 517", "addressLocality": "New York", "addressRegion": "NY", "postalCode": "10001", "addressCountry": "USA" } }

Control Statements Flashcards

(11 cards)

1
Q

What is the use of the if -else control structures

A

They are used to test conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Check the syntax for if statements

A
if statement syntax 
if(condition){
//code to be executed
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the C++ if else statement syntax

A
if statement syntax 
if(condition){
//code to be executed
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the C++ If - else-if ladder Statement

A
if(condition1){    
//code to be executed if condition1 is true    
}else if(condition2){    
//code to be executed if condition2 is true    
}    
else if(condition3){    
//code to be executed if condition3 is true    
}     
else{    
//code to be executed if all the conditions are false    
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does a switch statement do in C++

A

Executes one statement from multiple conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the syntax of the switch statement

A
switch(expression){      
case value1:      
 //code to be executed;      
 break;    
case value2:      
 //code to be executed;      
 break;    
......      
default:       
 //code to be executed if all cases are not matched;      
 break;    
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the use of a for loop

A

It is used to iterate a part of the program several times.

! If the number of iteration is fixed !

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the syntax of a for loop

A
for(initialization; condition; incr/decr){    
//code to be executed    
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a nested for loop

A

This is a for loop inside another for loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a while loop

A

it is a structure used to iterate a part of the program several times .!If the number of iterations is not fixed !

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the syntax of a while loop

A
while(condition){    
//code to be executed    
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly