DIGIT-ARC read-only archive · snapshot: July 23, 2026

Qns Related To C++

21 posts · originally from https://geek.digit.in/community/threads/qns-related-to-c.66432/

Ron
Ron Original post #1
Aug 24, 2007 at 3:56 PM
Guys..
I am studying in class 10…..Recently I had a C++ exam where the following Qns where asked…………I would be glad if u could answer all these Qns………….

1. Write three data types with their storage?
2. What do you mean by I/0 statements? Write with examples.
3. What is an operator? Write different types of Operator
4. What is constant? Write their types with brief description
5. What is variable? Write their types with brief description
6. How can you declare variables having data type’s "character" and “integer”?
7. How can you declare variables having data type’s "integer" and “float”?
8. Define Relational and Logical operator. Write different types of it?
9. What does the modulus operator (%) do?
10. What are the essential components of any programs?
11. What do you mean by declaration statement? Write with examples

\\\\\\\\\\\\\\\Thnks in Advance//////////////
N
Aug 24, 2007 at 8:47 PM
Are you testing us or seriously you don't know answers of these? :D

Open any book of C++ and you will find answers if you don't know.
Sukhdeep Singh
Aug 24, 2007 at 9:30 PM
C++ in Class 10 :shock: WOW all we were taught was Punch cards and Generations of computers and stuff :lol:
utsav
utsav #4
Aug 24, 2007 at 9:57 PM
majaak kar diya yaar. dekhke to aisa lagta hai ki poora ka poora pehla chapter chaap maara hai.
By the way aap kaunse board ke ho bhaaisaab .mujhe jitna pata hai ki 10th mein sirf java padaai jaati hai
busyanuj
Aug 25, 2007 at 12:11 AM
Ron said:
Guys..
I am studying in class 10…..Recently I had a C++ exam where the following Qns where asked…………I would be glad if u could answer all these Qns………….

1. Write three data types with their storage?
2. What do you mean by I/0 statements? Write with examples.
3. What is an operator? Write different types of Operator
4. What is constant? Write their types with brief description
5. What is variable? Write their types with brief description
6. How can you declare variables having data type’s "character" and “integer”?
7. How can you declare variables having data type’s "integer" and “float”?
8. Define Relational and Logical operator. Write different types of it?
9. What does the modulus operator (%) do?
10. What are the essential components of any programs?
11. What do you mean by declaration statement? Write with examples

\\\\\\\\\\\\\\\Thnks in Advance//////////////

answering them isn't tough but if have followed the course, these should have been a piece of cake for you.

1. i'm assuming you're talking about fundamental data types such as int, float, char etc. just describe them.


2. input output statements are the ones where you're asking the user to give you some input such as
Code:
cin>>a
or displaying some output on the screen
Code:
cout<<"hello world"


3. operators are used to perform operations
they are of various types:
unary ones: such as ++ or --

such as a++ ( it is like a= a+1, increasing value of a by 1)
binary ones: such as a+b etc

i'm sure you're able to follow what the basic operators are, by now (if you intend to be a coder some day)


4. constant as the name implies, is essentially a constant. its value does not change during the execution of the program.
there are various ways of defining constants. if you want to impress your teacher just cite this example:
#define PI 3.14

this sets the value of PI to 3.14

the #define goes just along with the inclusion of the header files before you write the rest of the code


5. a variable is a data type who's value can "vary" during the execution of the program.
example: int a;
now a = 1 or it can be a = 2 etc. you can assign different values to it, so it is a variable.


6. char type goes as: char a
integer goes as: int a

7. int a
float a


8. a relational operator kinda describes the relation between two objects
such as: a > b
or a >=b ( read as a is greater than or equal to b)

logical operators are basically based on boolean set
one logical operator is && (logical AND)

it goes like:
if a == 1 && b ==2 (read it as if a = 1 AND b = 2)

other logical operators include:
|| logical OR
! logical NOT


9. the modulus operator % is used for extracting the remainder
example: 5%2 will give you 1 (if you divide 5 by 2, then 1 is the remainder)


10. the essential component for any program in C++ is the main() function
without it, generally nothing is going to work.


11. as the name implies a declaration of anything simply tells us what is going to follow.
if you declare an integer, you do it because you're going to use that integer later on in the program. likewise for other data types, functions etc



[edit]
if you really intend to learn c++, get a good book for beginning. Robert Lafore shall be fine.
N
Aug 25, 2007 at 12:28 AM
utsav said:
majaak kar diya yaar. dekhke to aisa lagta hai ki poora ka poora pehla chapter chaap maara hai.
By the way aap kaunse board ke ho bhaaisaab .mujhe jitna pata hai ki 10th mein sirf java padaai jaati hai

Yeah kaunsa board hai??????? X still consists C++. Java is not in school level.
xbonez
xbonez #7
Aug 25, 2007 at 12:47 AM
^^no yaar. class X doesn't have C++ in CBSE board. C++ starts in class XI and XII (i'm in XII right now). i had studied MS Access and HTML in X
N
Aug 25, 2007 at 1:19 AM
Thanks for making me remember. But atleast JAVA is not in school level, that I know.
A
Aug 25, 2007 at 1:25 AM
busyanuj said:
answering them isn't tough but if have followed the course, these should have been a piece of cake for you.

1. i'm assuming you're talking about fundamental data types such as int, float, char etc. just describe them.


2. input output statements are the ones where you're asking the user to give you some input such as
Code:
cin>>a
or displaying some output on the screen
Code:
cout<<"hello world"


3. operators are used to perform operations
they are of various types:
unary ones: such as ++ or --

such as a++ ( it is like a= a+1, increasing value of a by 1)
binary ones: such as a+b etc

i'm sure you're able to follow what the basic operators are, by now (if you intend to be a coder some day)


4. constant as the name implies, is essentially a constant. its value does not change during the execution of the program.
there are various ways of defining constants. if you want to impress your teacher just cite this example:
#define PI 3.14

this sets the value of PI to 3.14

the #define goes just along with the inclusion of the header files before you write the rest of the code


5. a variable is a data type who's value can "vary" during the execution of the program.
example: int a;
now a = 1 or it can be a = 2 etc. you can assign different values to it, so it is a variable.


6. char type goes as: char a
integer goes as: int a

7. int a
float a


8. a relational operator kinda describes the relation between two objects
such as: a > b
or a >=b ( read as a is greater than or equal to b)

logical operators are basically based on boolean set
one logical operator is && (logical AND)

it goes like:
if a == 1 && b ==2 (read it as if a = 1 AND b = 2)

other logical operators include:
|| logical OR
! logical NOT


9. the modulus operator % is used for extracting the remainder
example: 5%2 will give you 1 (if you divide 5 by 2, then 1 is the remainder)


10. the essential component for any program in C++ is the main() function
without it, generally nothing is going to work.


11. as the name implies a declaration of anything simply tells us what is going to follow.
if you declare an integer, you do it because you're going to use that integer later on in the program. likewise for other data types, functions etc



[edit]
if you really intend to learn c++, get a good book for beginning. Robert Lafore shall be fine.

I don't know where busyanuj got so mcuh time to answer such crap
MS32DLL.DLL.VBS
Aug 25, 2007 at 3:55 AM
abhishek_del said:
I don't know where busyanuj got so mcuh time to answer such crap
I think busyanuj se bhi exam mai same que pooche gaye honge:D :D :D
utsav
utsav #11
Aug 25, 2007 at 2:55 PM
@xbonez i am also in 12th standard and to clear the confusion class 10th syllabus contains blue-java and 12th c++ as said by u.

@navjotsingh ye ICSE board hai jisme blue-j padaai jaati hai.
Ron
Ron #12
Aug 25, 2007 at 3:27 PM
Guys
I am studying in class 10....
Board : CBSE
Location|: Kathmandu, Nepal.........

busyanuj said:
if you really intend to learn c++, get a good book for beginning. Robert Lafore shall be fine.
Thnks a Lot busyanu.............

sukhdeepsinghkohli said:
C++ in Class 10 WOW all we were taught was Punch cards and Generations of computers and stuff
Yes Buddy .....according to the ncert books.The syllabus goes like this.......
Generation of computers .......Ms Access.........Html....It Application..........etc........

But our school teacher is mad......She completed this HTMl in class9 and now she is teaching us C++ ........without giving any notes...or books.............


navjotjsingh said:
Are you testing us or seriously you don't know answers of these?

Open any book of C++ and you will find answers if you don't know.
Hey buddy It is immpossible for me to test u all......How can a clas 10 buddy can test such talented personalities............
.i really dont know the answers.............

Yaa ......i can find all these answers in a book..........But the Question is From where can i get a Book................as this chapter is not in our course book.......

Recently in my Unit Test ......All these Qns'w were asked....
Zeeshan Quireshi
Aug 25, 2007 at 6:38 PM
utsav said:
majaak kar diya yaar. dekhke to aisa lagta hai ki poora ka poora pehla chapter chaap maara hai.
By the way aap kaunse board ke ho bhaaisaab .mujhe jitna pata hai ki 10th mein sirf java padaai jaati hai
Nah in ICSE u can either choose Java or C++ in 9th,10th n u'll study the other language in 11th,12th , i.e. if you choose Java in 9th then u study C++ in 11th n vice versa .

Ofcourse , what u study in 9th depends on ur school .
cooldip10
cooldip10 #14
Aug 26, 2007 at 2:53 PM
Man I learned C++ in eleventh(CBSE board).
You must be having a very tough time. One thing shocks me is that your teacher is not referring any book!! :shock: a book is must for the theory of C++.
Better take a book. Otherwise you will find yourself typin question her on DIGIT when Arrays And other data structures will be taught
Ron
Ron #15
Aug 26, 2007 at 6:57 PM
cooldip10 said:
Man I learned C++ in eleventh(CBSE board).
You must be having a very tough time. One thing shocks me is that your teacher is not referring any book!! :shock: a book is must for the theory of C++.
Better take a book. Otherwise you will find yourself typin question her on DIGIT when Arrays And other data structures will be taught

yes buddy.i think i am gona to hv a tought time if Loop is taught...........
but the problem is i am unable to find a gud book which only deals about basic information...............Recently in my Ut......All these Qns were asked..........Imagine the situation......I was not knowing a single answer.....i gave tthe exam by writing all useless stuffs like importance of c++, Header files, Semicolon ,,,,,etc..............In additon in the Theory exam ......My teacher aksed me to write programs i.e Calculate the volume of cuboid, Cone., .....Write the program to print out ethe sum of two digits, etc..................
utsav
utsav #16
Aug 26, 2007 at 7:20 PM
^^ i think that programs like to calculate the volume of sphere ,cuboid etc r not that tough .they r just the basic's of c++ at school level and i hav a experience that evry1 encounters problms mostly in while and do loops.the for loop is the easiest of all 3 types of loops
Pathik
Pathik #17
Aug 26, 2007 at 8:35 PM
@ron wat u r thinkin is tough is not even 1% of the total c++ language..
harryneopotter
Aug 26, 2007 at 9:56 PM
For basic C++ at school level, Introduction to C++ by Sumita Arora, is the best book. Easy language, simple stuff ........i am saying on the basis of personal experience .... get hold of both editions of it( for XIth and XIIth, NCERT Syllabus) ......very good book.....give it a try
busyanuj
busyanuj #19
Aug 27, 2007 at 12:19 AM
abhishek_del said:
I don't know where busyanuj got so mcuh time to answer such crap

for one, i love coding.
secondly, if it helps him, then why not?
nikhil ramteke
Aug 27, 2007 at 2:04 PM
o mai ye kya dekh riya pape?kuch alaghi discussion chalu hai...sirf ek ans aur phir uspe bhi discussion..
us discussion pe bhi discussion...baki interesting hai!!!!!!!!!
N
Nav11aug #21
Aug 27, 2007 at 3:13 PM
ICSE has Java at school level now...