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

  Calculate the component voltages

Calculate the component voltages for the following series resonant RLC circuit

  Write a function num_digits(n)

C programing, not C++ write a function num_digits(n) that returns the number of digits in a nonnegative integer n.

  Write a program code to compute and build a table of reynold

Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)

  Use a define statement to create a constant

Follow these specifications: Use a define statement to create a constant that will hold your student number. You should have separate string variables for your first and last name; name these first_name and last_name.

  Program to produce ten random permutations of numbers

In C++(must be able to compile in Visual Studio ): Write a program to produce ten random permutations of numbers 1 to 10.

  Skills required by personnel working in information security

What skills are required by personnel working in information security? Write down some job titles in the field and come up with some required qualifications and some desirable qualifications.

  Illustrate example from ansi c programming language

Illustrate example from ANSI C programming language, without using nested procedures, to show the fact that "assignment-by-sharing in conjunction with quasi-dynamic object binding

  Calculate the trajectory of a soccer ball

Write a program to calculate the trajectory (flight path) of a soccer ball

  Prepare an accounting for a dorm''s kitchen

The "purpose" of the program is to prepare an accounting (database) for e.g. a dorm's kitchen, to keep track of the consumption of beer for each room.

  Prepare a linear support vector machine svm

Write a computer program to prepare a Linear Support Vector Machine SVM

  Prompts the user to enter an integer

Write the code that prompts the user to enter an integer between 1 and 20 (including 1 and 20), reads the value using cin, and then prints the value that they entered in a statement that begins with "You entered a ". Save this version in a separate l..

  Write a program that reads numbers

Write a C++ program that reads N positive numbers from the keyboard, calculates and shows the smallest number of all numbers

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