Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

1.

Firstly, I would refer a few great books and secondly, I would tell her to consult the
Professor.
2. Yes
3. Pre-processor statements in the code of programs are always preceded by a hash sign (#).
4. All statements in C++ are terminated using a semicolon(;).

5.
C // This is a simple program that does nothing useful.
P #include <iostream>
P #include <cmath>
C //#include <algorithm>

int main() {
std::cout << "#include <iostream>"<< "allows me to print to the
console"
<< std::endl;
C //cout << "#include <algorithm> gives me algorithms"<< std::endl;
return 0;
}
C /* This is the end of file.*/

6. Any sequence of decimal digits that has a decimal point (period) somewhere is considered a
floating-point literal while Any sequence of decimal digits not starting with a 0 is interpreted
as an integer literal, possibly prefixed with either + or -.

7. “1” is a string literal.


‘1’ is a character literal.
1 is an integer literal.
Further, the memory allotted to each the above literal is different.

8. std::cout<<”\’ \’ \\ / _ \\ / Welcome to ECE 150! \\ \\ \\ \\ \’ \’”

9. ([+]&[1])?[1-9][0-9] [0-9] [0-9] [0-9] [0-9] [0-9] [0-9] [0-9] [0-9]

10. Function declaration: A statement that tells the computer that a function with a specific
name will be used. The compiler will use this information to ensure that the function is
properly defined and used.
Function definition: The description of what a function is to do, usually including the
function declaration without the semicolon followed by a block of statements. When the
function is called, it is the block of statements following the function definition that will be
executed in the given order.

11. Function declaration tells the compiler that a function with a specific name and 0 or more
parameters and their data types will be used. The compiler will use this information to
ensure that the function is properly defined and used.
12. int one(); //function declarations
bool is_one( int value ); //function declarations
int main(); //function declarations

int one() //function definitions

return 1;

bool is_one( int value ) //function definitions

return (value == one());


}
int main() //function definitions

std::cout << “one?: “ << is_one(5) << std::endl;


return 0;

13. Main() function is the entry point of any C++ program. It is the point at which


execution of program is started. When a C++ program is executed, the execution
control goes directly to the Main() function.
14.

You might also like