Class Vii - Chapter-3
Class Vii - Chapter-3
CHAPTER 3
INTRODUCTION TO C++
Ans: Differently
Ans:.h
Ans: iostream
Ans: Both
Ans:switch
(a) The void data type is used for empty set of values.
(c) If any of the value does not match in SWITCH statement, then default is
executed.
(c) The function main() is the basic function for all programs.- True
ANS:
#include <iostream>
return 0;
ANS:
# include <iostream>
int main()
int price=200;
cout<< price;
return 0;
ANS:
# include <iostream>
int main()
BHPS/EMP258/LESSON-3/VII/COMPUTER SCIENCE 2023-‘24 Page 3
{
int item;
cin>> item;
return 0;
ANS:
# include <iostream>
int main()
int a,b,c,sum;
cin>> a;
cin>> b;
cin>> c;
sum =a+b+c;
return 0;
ANS:
# include <iostream>
int main()
{
int a,b;
cout << “Enter the first number=”;
cin>> a;
cout << “Enter the second number=”;
cin>> b;
ANS:
Identifiers are the variables in C++ used for defining variables, constants and
functions. Identifiers must begin with a letter(a….z or A….Z) or an underscore (
_ ) .Uppercase and Lowercase letters are different.
ANS: A header file is a file with extension .h which contains C++ function
declarations and macro definitions to be shared between several source files.
ANS:
Initialization expression sets the initial value of the loop control variable
which acts as a counter that controls the loop.
The condition Expression is a condition that determines whether the loop
will repeat or not.
The update expression defines the number by which the loop control
variable will change each time the loop repeated.
ANS:
BHPS/EMP258/LESSON-3/VII/COMPUTER SCIENCE 2023-‘24 Page 6
IF statement IF..ELSE statement
IF statement tests a particular IF ELSE statement decides
condition which of two actions to be
If the condition is true a performed . If the condition is
statement or a set of statement true, the statement after if will
is executed otherwise control be executed otherwise the
will go to next statement statement after else will be
executed.