C++ Questions Answers-C++ basic syntax(PartI)


C++ basic syntax(PartI)

1. What is the purpose of using iostream header file? Check answer 2. The cin>> input statement is used to receive data from keyboard.
a.True b. False Check answer 3. The cout<< output statement is used to print text on the screen.
a.True b. False Check answer 4. Each C++ program may have many main functions.
a.True b. False Check answer 5. A comment in C++ language starts with */ and ends with /*.
a.True b. False Check answer 6. Which of the following is not a standard data type?
a.int    b.char    c.float    d.date Check answer 7. In C++ language, Which one is not the integer value?
a.12    b.'23'    c.10    d.100 Check answer 8. What is the type of each of the following constants?
a.10    b.'2'    c.10.7    d."12" Check answer 9. What is the type of each of the following constant?
a."Dara"    b.'2.9'    c."10.7"    d.13.9f    e.'\a' Check answer 10. Find any errors in the following C++ program:
#include<iostream>
using namespace std; void main(){ /* This is the main function*/
cout<<"Hello"
return 0;
}
Check answer


Comments

rajib rahman comment

 rajib rahman

Write a program that that prints shapes such as Square, Triangle, Right angle Triangle using functions. We had done a problem like such in the class and also in the previous assignments. Simply convert it and use functions instead. Each shape have its own function.
Example , if you wish to draw a square using function:
void drawSquare(int height){
// your code
}
Height has to be passed from main function and it must come from the user. The user can choose which shape they want to see unless the press ‘Q’ to quit.
how to solve this??


2016-12-06
vishal kahar comment

 vishal kahar

Create a class add through which user will be able to add three variable Data and display results.considering following facts

1) user will give no input
2) user will give at least one input
3) user will give at least two inputs
4) user will give all inputs

Hint: consider default for the variables be 0 if no input is specificed



2016-09-29
Emmanuel Mark comment

 Emmanuel Mark

I want to Write a C++ program that can use a linked list to store 10 student records with the following fields: Registration number, marks and grade. The program should allow the user to enter the records one after the other then display results on the screen. Help me please.


2016-03-28
akash comment

 akash

Write a function that takes in a string parameter and checks to see whether or not it is an integer, and if it is then return the integer value. can u plzz help me widdis program


2016-01-11
lolo comment

 lolo

There are two types of egg cartons.

One type contains 6 eggs and the other type contains 8 eggs. John wants to buy exactly n eggs.

Help John find the minimum number of cartons he should buy.
Input

The first line of input contains a single integer T(1 â


2015-12-19
bdict comment

 bdict

pls help how to write a c++ allows you to input on integer between 0.999 and add all the digit in the integer


2015-12-02
bdict comment

 bdict

pls help how to write a c++ allows you to input on integer between 0.999 and add all the digit in the integer


2015-12-02
abhishek comment

 abhishek

template class to store an array of n values where the type of the array and the value of n are passed as arguments to the templates


2015-11-18
Hamza Khan comment

 Hamza Khan

i Want To Have a change a Program So Plzzz HeLp me


2015-11-05
James F. comment

 James F.

create a program that prompts the user for a number x and output the sum of all numbers from 1 to x. If the number entered is less than zero, output an error message.


2015-10-18
James F. comment

 James F.

create a program that prompts the user for a number x and output the sum of all numbers from 1 to x. If the number entered is less than zero, output an error message.


2015-10-18
parth comment

 parth

Create a class Item that has I_no, I_name, I_cost as data member and void getitem(void) and void
putitem(void) as member functions. Write appropriate main() function for it


2015-08-25
Aqeel Saeed comment

 Aqeel Saeed

How i could put hyphens in a c++ program for cnic number ?


2015-08-04
Sehar  comment

 Sehar

Write a programm that uses the following categories of movies
A for Adventure movies
C for comedy movies H for Horror Movies
S for Science fiction movies
The programm inputs code for movie type an d display its category


2015-05-10
jacket comment

 jacket

I like this


2015-03-16
ahemad comment

 ahemad

hi


2015-02-26
ahemad comment

 ahemad

hi


2015-02-26
Rabe comment

 Rabe

Print a M-row by N-column multiplication table as following. The table should include one header row and one header column. Thr size of the table (M by N) is determined by users .

1 2 3 4 5 6 ... N

1 1 2 3 4 5 6 ...

2 2 4 6 8 10...

...

M .................................


2015-02-26
Dara comment

 Dara

www.worldbestlearningcenter.com /index_files/cpp-tutorial-more_functions_exercises.htm


2015-02-23
ali comment

 ali

Print a M-row by N-column multiplication table as following. The table should include one header row and one header column. The size of the table (M by N) is determined by users .?


2015-02-23
CAPTCHA image



This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.