Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

problem 1:

a) The statement #include is normally added at the strating of a program. What is the purpose of this statement?

b)

  • Describe what is meant by explicit type conversion.
  • Give a simple ex to support your answer to part (i)

c)  Find out the trace table for the given program:

1. //Program to illustrate arithmetic operations

2. #include

3. using namespace std;

4. 

5. int main() {

6. int ThisVal, ThatVal, ThisVal2;

7. const int TheVal = 5;

8. 

9. ThisVal = 3;

10. ThatVal= 2 * ThisVal + 7 / ThisVal * TheVal;

11. ThisVal2 = ThatVal * ThisVal / 9 + 8;

12. 

13. cout << “ThisVal = “ << ThisVal;

14. cout << “; ThatVal = “ << ThatVal << endl;

15. cout << ThisVal2 = “ << ThisVal2;

16. cout << “; TheVal = “ << TheVal << endl;

17. 

18. return 0;

19. }

d) prepare a program which displays all the odd numbers from 1 to 100 on separate lines. Use for loop.

e) What is the output when the given code fragment is executed?   

  char ch;

  char title[] = "Programming";

  ch = title[1];

  title[3] = ch;

  cout << title << endl;

  cout << ch << endl;

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M96116

Have any Question? 


Related Questions in C/C++

Programming assignment-1 program specification1 your

Programming Assignment- 1. Program Specification 1. Your program must read 8-bit ASCII strings from standard input -- for instance, using the cin object in C++, or stdin in C. You must consume all input from standard inp ...

Writeacprogramthatwilluseloopstoperformeachofthefollowingtas

Write a C++ program that will use loops to perform each of the following tasks: 1. Ask the user for two characters from the keyboard and read them into char variables. Determine which input is larger and which is smaller ...

For this program you will add and test 2 new member

For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, intpos) Assuming that the positions of elements of a list beg ...

Problem 1 you are tasked to write a program that outputs

PROBLEM 1 You are tasked to write a program that outputs the following amplifier system specifications: Voltage amplification: 25 Input voltage: 50 mV Power output: 2.5 W Bandwidth: 15 kHz Type: Class A a. For this progr ...

Computer scienceprogram-write a c program that willpresent

Computer Science Program- Write a C++ program that will: Present the user with a menu of choices: 1. Random number 2. String 3. Type Casting 4. Integer Math Then, in an if-else if structure (or switch) write the code for ...

1 requirementsin this assignment you can unleash your

1. REQUIREMENTS In this assignment, you can unleash your imaginations and use OpenGL with C/C++ programming to produce a scene(s) that represents what you envision could possibly be seen under the sea. Please note that a ...

Write code to create the generator submit your source code

Write code to create the generator. Submit your source code as well as a description of how I could run the program, sample screenshots of the program in action, and the various changes that could be produced through you ...

Objectives- gain experience with if if else and switch

Objectives - Gain experience with if, if else, and switch statements in C programs. - Experience using % operator and true false logic. Hints This program will be MUCH easier if you design how to do the logic in your own ...

Write a program that calculates mileage reimbursement for a

Write a program that calculates mileage reimbursement for a salesperson at a rate of $0.35 per mile. Your program should interact with the user in this manner: MILEAGE REIMBURSEMENT CALCULATOR Enter beginning odometer re ...

More often than not entrepreneurs will fail several times

"More often than not, entrepreneurs will fail several times before they make it and will usually learn a lot in the process. To help these entrepreneurs to succeed will require a cultural shift. We need to encourage Aust ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate