C++ Quiz 1

C++ Quiz 1

Identifier cannot be a …..





Which of the following is an invalid identifier?





What is the output of the following code? #include< iostream.h> using namespace std; void main() { int a=1; switch (a) { case 1: cout<<”OK”; case 2: cout<<”BYE” default” cout<<”Nothing” } }





What will be the output of following code? #include< iostream.h> using namespace std; int main() { int i=10; if(i=20) cout << i ; return 0; }




Variable defined with a function is called …..





If we know the number of iterations, then we should use ….. loop.





What will be the output of following code ? #include "iostream" using namespace std; void main() { int i, sum=0; for(i=1;i<=10;i++) sum+=i; cout<<i; getch(); }





….. is a collection of attributes and behaviors.





A variable to store a decimal value can be declared as below.





Every user-defined C++ function must start and end with…..







Search

Shortcodes Ultimate

 
Follow Us
 
BGP