Professional Documents
Culture Documents
COSC 102 MID SEM Soln2018
COSC 102 MID SEM Soln2018
1. Bjarne Stroustrup
2. Object orientation and additional standard libraries
3. Strongly typed means variable must be declared before use
4. Preprocessor directives contain the definition of some predefined fuctions like
<iostream> has the definition of functions like cin and cout.
Executable statements are line of codes written by a programmer to perform his
specific intention. E.g. x = x +1; // to increase the value of x by 1.
5. Const int day = 7;
6. cout<<”\“CHURCH BOYS RUN FROM STRANGER\’S CLUB:\tDOES IT MATTER\?\” ”
7. #define SMALLER(x, y) ((x)<(y) ? (x) : (y) )
8. #define SQUARE(x) (x * x)
9. Dice not defined
10. The lifespan of a local variable is the function within which it is declared
11. Global variable is declared outside all the functions in a program and that is usually
before the main() function.
int x; // x is a global variable here
int main(){….}
12. The local variable takes precedence within the same program
13. The scope of a parameter within a function is local to that function
14. Given that x =5, Y =6;
x%y = 6
++x = 6
y++ = 6
15. if(x >=10 && x <=15) {…..}