Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

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

problem2. describe what is meant by explicit type conversion.

problem3. Determine the trace table for the following program:

1. //Program to illustrate arithmetic operations

2. #include

3. Using namespace std;


5. int main() {

6. int ThisVal, ThatVal, ThisVal2;

7. const int TheVal = 5;


9. ThisVal = 3;

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

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


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

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

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

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


18. return 0;

19.  }

problem4. prepare a program that displays all the odd numbers from 1 to 100 on separate lines. Use for loop.

problem5. What is the output when the following code fragment is executed?

  char ch;
  char title[] = "Programming";
  ch = title[1];
  title[3] = ch;
  cout << title << endl;
  cout << ch << endl;

problem6. What is the least number of times the body of a while loop can be executed?

problem7. What is wrong with the following loop:

      While (n<=100)
      Sum += n*n;

problem8. prepare a program that reads the prices of zero or more items, and displays the total price with 14% sales tax added. (Hint: the program will know when the last price has been read if a price of 0.00 is entered)

problem9. prepare a program that reads in two floating point numbers and then performs one of four operations on them: addition, subtraction, multiplication or division. The program must ask the user which one of the operations to perform. Use a switch statement to perform the correct operation and display the result.

C/C++, Programming

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

Have any Question? 

Related Questions in C/C++

Intro to programming in c programming assignmentassignment


Write a c program that requests the name of any cartoon

Write a C program that requests the name of any cartoon character from the user, then does the following with that name (use printf for each): a. Displays it enclosed in double quotes. b. Displays it in a field 24 charac ...

Write a c program that calculates and prints the average of

Write a C program that calculates and prints the average of two or more salaries entered by the user. The program should first prompt the user to enter the number of salaries to process (make sure: at least 2 salaries mu ...

1 three employees in a company are up special pay increase


1 we know that from ece 109 to calculate the


Computer applications divisionassignment c programmingstl


Assignment part acreate a checkbook program using c

Assignment (part a) Create a Checkbook program using C : • Create a Check structure. Include:   o Check number (should be an integer).   o Date (use type char[ ]).   o To   o Amount   o Description • Add functions to:   ...

Programming in c assignmentwrite a c program that computes


Write a c application that does the followingitem 1 prompts

Write a C++ application that does the following: ITEM 1: Prompts the user to choose one of the following series: 1 + 1/2 + 1/3 + ... + 1/n ((((x * 2) * 2) * ...) * 2) series of n multiplications x + (x * 1) + (x * 2) + ( ...

Assignmentwhen writing c programs include comments in your


  • 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


Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of


Part 1you work in hr for a company that operates a factory


Details on advanced accounting paperthis paper is intended


Create a provider database and related reports and queries


Describe what you learned about the impact of economic
