Code With Margaish
Powered by
Blogger
.
About us
Privacy Policy
Disclaimer
Contact Us
Home
Thursday, 23 July 2020
C++
Single Inheritance Example C++
by :
Abdul Rehman Margaish
July 23, 2020
0
Single Inheritance Example C++: #include<iostream> using namespace std; class base{ int data1; public: int data2; void setda...
Read More
Wednesday, 22 July 2020
C++
Inheritance Of Classes in C++
by :
Abdul Rehman Margaish
July 22, 2020
0
// Derived Class syntax /* class {{derived-class-name}} : {{visibility-mode}} {{base-class-name}} { class members/methods/etc... } Note...
Read More
Tuesday, 21 July 2020
Chapter 2
18. 2.24 (Odd or Even) Write a program that reads an integer and determines and prints whether it’s odd or even. [Hint: Use the remainder operator (%). An even number is a multiple of two. Any multiple of 2 leaves a remainder of zero when divided by 2.]
by :
Abdul Rehman Margaish
July 21, 2020
0
18. 2.24 (Odd or Even) Write a program that reads an integer and determines and prints whether it’s odd or even. [Hint: Use the remainder op...
Read More
Chapter 2
17. 2.23 (Largest and Smallest Integers) Write a program that reads in five integers and determines and prints the largest and the smallest integers in the group. Use only the programming techniques you learned in this chapter.
by :
Abdul Rehman Margaish
July 21, 2020
0
17. 2.23 (Largest and Smallest Integers) Write a program that reads in five integers and determines and prints the largest and the smallest ...
Read More
Chapter 2
15. 2.21 (Displaying Shapes with Asterisks) Write a program that prints a box, an oval, an arrow and a diamond
by :
Abdul Rehman Margaish
July 21, 2020
0
15. 2.21 (Displaying Shapes with Asterisks) Write a program that prints a box, an oval, an arrow and a diamond #include <iostream> u...
Read More
Chapter 2
14. 2.20 (Diameter, Circumference and Area of a Circle) Write a program that reads in the radius of a circle as an integer and prints the circle’s diameter, circumference and area. Use the constant value 3.14159 for Ï€. Do all calculations in output statements. [Note: In this chapter, we’ve discussed only integer constants and variables. In Chapter 4 we discuss floating-point numbers, i.e., values that have decimal points.]
by :
Abdul Rehman Margaish
July 21, 2020
0
14. 2.20 (Diameter, Circumference and Area of a Circle) Write a program that reads in the radius of a circle as an integer and prints the ci...
Read More
Chapter 2
13. 2.19 (Arithmetic, Smallest and Largest) Write a program that inputs three integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers
by :
Abdul Rehman Margaish
July 21, 2020
0
13. 2.19 (Arithmetic, Smallest and Largest) Write a program that inputs three integers from the keyboard and prints the sum, average, produc...
Read More
Chapter 2
12. 2.18 (Comparing Integers) Write a program that asks the user to enter two integers, obtains the numbers from the user, then prints the larger number followed by the words "is larger." If the numbers are equal, print the message "These numbers are equal."
by :
Abdul Rehman Margaish
July 21, 2020
0
12. 2.18 (Comparing Integers) Write a program that asks the user to enter two integers, obtains the numbers from the user, then prints the l...
Read More
Chapter 2
by :
Abdul Rehman Margaish
July 21, 2020
0
2.17 (Printing) Write a program that prints the numbers 1 to 4 on the same line with each pair of adjacent numbers separated by one space. ...
Read More
Chapter 2
10. 2.16 (Arithmetic) Write a program that asks the user to enter two numbers, obtains the two numbers from the user and prints the sum, product, difference, and quotient of the two numbers.
by :
Abdul Rehman Margaish
July 21, 2020
0
10. 2.16 (Arithmetic) Write a program that asks the user to enter two numbers, obtains the two numbers from the user and prints the sum, pro...
Read More
C++
5.15 (Triangle-Printing Program) Write an application that displays the following patterns separately, one below the other. Use for loops to generate the patterns. All asterisks (*) should be printed by a single statement of the form cout << '*'; which causes the asterisks to print side by side. A statement of the form cout << '\n'; can be used to move to the next line. A statement of the form cout << ' '; can be used to display a space for the last two patterns. There should be no other output statements in the program. [Hint: The last two patterns require that each line begin with an appropriate number of blank spaces.]
by :
Abdul Rehman Margaish
July 21, 2020
0
5.15 (Triangle-Printing Program) Write an application that displays the following patterns separately, one below the other. Use for loops to...
Read More
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)