Write a program with a while loop to print 1 to n in square

Assignment Help C/C++ Programming
Reference no: EM13162482

Write a program with a while loop to print 1 to N in square brackets. N is an integer input from the user.

(i) Write the same program using a for-loop

(ii) Write the same program that will display only the even numbers and odd numbers from 1 to N.

 

 

Reference no: EM13162482

Questions Cloud

C program to solve the quadratic equation of rocket launch : Write a C program to solve the quadratic equation of rocket launch by computing the roots (t1 and t2) of that quadratic equation: gt2 + vt + l = 0 (or) for simplicity ax2 + bx + c = 0. Get the values of g, v, and l from the user. The program should d..
Compute the partial pressure of no : At equilibrium the total pressure was 1.00 atm and the NOCl prssure was 0.27 atm. 2NOCl(g) &hArr 2NO(g) + Cl2(g) Calculate the partial pressure of NO and Cl2 in the system
State what is the partial pressure of ibr at equilibrium : What is the partial pressure of Br2 at equilibrium? What is the partial pressure of I2 at equilibrium? What is the partial pressure of IBr at equilibrium?
Compute the molar amounts of naoh used in the reaction : Calculate the molar amounts of NaOH used in the reaction with the HCI solution and with the HC2H3O2 solution?
Write a program with a while loop to print 1 to n in square : Write a program with a while loop to print 1 to N in square brackets. N is an integer input from the user. (i) Write the same program using a for-loop
The triprotic acid has ionization constants : Calculate the following values for a 0.0150 M solution of NaH2A. and Calculate the following values for a 0.0150 M solution of Na2HA.
Compute the concentrations of all species sodium sulfite : Calculate the concentrations of all species in a 1.01 M Na2SO3 (sodium sulfite) solution
Convert the erd : Using the descriptions of the attributes given in the, convert the ERD shown in Figure P6.2 into a dependency diagram that is in 3NF.
The mole ratio of the balance equation calculate the moles : Using the Moles of HCL and the mole ratio of the balance equation calculate the moles of NaHCO3 that reacted with the HCL

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Perform operations on arrays

Perform operations on arrays execute tests and repetitions

  Least number of comparisons needed

What is the least number of comparisons needed to sort an array of 6 numbers, in the worst case, using any sorting algorithm that sorts with binary comparisons? Explain

  Write a complete c++ program

The main program will read in a parameter value n (read this in main). Then it will call a function read2arrays (details below) to read lists of grades into two arrays, which the main program will call test1 and test2 (or some other names of your ..

  Write program to input series of hourly temperatures

Create and write a c++ program which inputs series of 24 hourly temperatures from file, and outputs bar chart (using stars) of temperatures for the day.

  Create a base employee class

Create a base Employee class and a derived StudentEmployee class

  Allows the user to enter the coefficients for a system

Create a graphical (not text-based) Visual C++ program that allows the user to enter the coefficients for a system of four equations with four unknowns. Include a button that when clicked, will solve the system of equations and display the results in..

  Write a program that plays a tic-tac-toe game.

Using functional decomposition, write a program that plays a tic-tac-toe game.

  Code to implement a staque

Write a C++ code to implement a Staque. Since the data structure is all about inserting and deleting numbers, it would be a good option to use a linked list to implement Staque.

  Write program to read from file to find number of integers

Write down the program which reads from file numbers.txt 30 integers in range 0 - 200. Program ‎then determines number of integers in each of given ranges.

  Program to enter number of values to be processed

Write c++ statements to permit the user to enter n, the number of values to be processed; then assign the anonymous array of n double values, storing its address in doublPtr.

  Program to compute and show miles per gallon

Create the program in C++ which will input miles driven and gallons used (both as integers) for each tankful. Program must compute and show miles per gallon.

  Prepare a program that uses at least two functions

Prepare a program that uses at least two functions that can be called from your main.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd