Write a c program to declare two integer one float


Q. 1 Write a C++ program to declare two integer , one float variables and assign 10, 15, and 12.6 to them respectively. It then prints these values on the screen.

Q. 2 Write a C++ program to prompt the user to input her/his name and print this name on the screen, as shown below. The text from keyboard can be read by using cin>> and to display the text on the screen you can use cout<<.

3. Write a program in c++ that prints a 'pyramid' shape of a specified height on the screen.

Q.4 Write a program that print the following menu and get a user choice and execute the program.

*****Menu****

1.Swap Number
2.Grade
3.Pyramid
4.Reverse
Enter a User choice:

Hint: Use switch statement or for exit from program use "exit (1);" statement.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a c program to declare two integer one float
Reference No:- TGS01604690

Now Priced at $30 (50% Discount)

Recommended (98%)

Rated (4.3/5)