All questions
- what is significance of including header files in your program Header files give the compiler the declarations (function prototypes, macros, constants and data types) of library functions, so that we can... 1
- Turbo c++ is not installing in laptop windows 10 Turbo c++ is not installing in laptop windows 10 You can run your c++ programs on online gdb turbo c++ compiler which is web based c++ compi... 1
- To study structure of c++ program //following is the simple C++ program . #include<iostream.h> void main() { cout<<"C++ better than C"; } Output:: https://lh3.googleuserconte... 1
- Write an Object Oriented Program in C++, to implement circle class to find area and circumference of a circle using functions void area(), void circum(). #include<iostream> using namespace std; class Circle { public: float radius, area_of_circle,circumference; void getRadius() { cout << "Enter... 1
- Write an Object Oriented Program in C++, to find the GCD of two given numbers. 225 and 45 #include <iostream> using namespace std; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int main() { int a = 225, b =... 2
- Write an Object Oriented Program in C++, to implement inventory class to calculate total price of number of items purchased. #include <iostream> using namespace std; class inventory { private: int no_of_items; float total_price; float price; public: void getData(vo... 1
- Write a program in C++, to find factorial of a given number using function void fact (int); #include <iostream> #include <conio.h> using namespace std; void fact(int num); int main(void) int num; cout<<"Enter the number to find fact... 1
- Write a program in C++, to read array of 10 elements and print its sum. #include<iostream> using namespace std; int main() { int arr[10],i,sum=0; cout<<"Enter any elements in Array: "; for(i=0;i<10;i++) { cin>>ar... 1
- Write a program in C++, to print first 15 terms of Fibonacci series Note:: This code only work on turbo c++ #include<iostream.h> #include<conio.h> void main() { int n1,n2,n,i; clrscr(); n1=0; n2=1; cout<<"Fib... 1
- Write a program in C++, to print the sum of first 100 natural numbers using for control structure. #include <iostream> using namespace std; int main() { int i, sum=0; for(i=1;i<=100;i++) { sum=sum+i; } cout<<"Sum of first 100 natural numbe... 1
- Write a program in C++, to find factorial of a given number using for loop. #include <iostream> using namespace std; int main() { int i,fact=1,number; cout<<"Enter any positive Number: "; cin>>number; for(i=1;i<=numb... 1
- Write a program in C++, to find if the given year is leap year or not using if else control structure. #include <iostream> using namespace std; int main() { int year; cout << "Enter a year to check: "; cin >> year; if (year % 4 == 0) { if (yea... 1
- Write a program in C++, to find maximum and minimum of two numbers using conditional operator. #include<iostream> using namespace std; int main() { int num1, num2, max, min; cout<<"Enter two numbers:"; cin>>num1>>num2; max = (num1 > nu... 1
- Write a program in C++, to find max of two numbers using if else control structure. #include<iostream> using namespace std; int main() int num1, num2, max_no; cout<<"Enter the Two Numbers: "; cin>>num1>>num2; if(num1>num2) m... 2
- In the figure 7.12, a cylindrical wrapper of flat tablets is shown. The radius of a tablet is 7 mm and its thickness is 5 mm. Radius of a tablet, r = 7 mm Thickness of a tablet, h = 5 mm Radius of cylindrical wrapper, R = 14/2 = 7 mm Height of wrapper (H) = 10 cm =... 1
- In figure 7.11, a toy made from a hemisphere, a cylinder and a cone is shown. Find the total area of the toy Answer: Total area of the toy = 273π cm² = 858 cm² (taking π=22/7 ). Radius of the hemisphere = radius of the cylinder = radius of the cone... 1
- A cylinder and a cone have equal bases. The height of the cylinder is 3 cm and the area of its base is 100 cm2 . Height of the cylinder, h = 3 cm Let the radius of the cylinder be r cm and the height of the cone be H cm. Area of the base of cylinder = 1... 1
- Observe the measures of pots in figure 7.8 and 7.9. How many jugs of water can the cylindrical pot hold ? Answer: The cylindrical pot can hold 12 jugs of water. Given: conical water jug: radius r = 3.5 cm, height h = 10 cm. Cylindrical water pot:... 2
- The dimensions of a cuboid are 44 cm, 21 cm, 12 cm. It is melted and a cone of height 24 cm is made. Find the radius of its base Radius is 21 cm 1
- Find the surface area of a sphere of radius 7 cm. Answer is 616 sq. cm 2
- Find the total surface area of a cylinder if the radius of its base is 5 cm and height is 40 cm. Given :: radius of base of cylinder= 5 cm height = 40 cm for cylinder, Total surface area of cylinder = 2π r (r+h) =2x3.14x5x(5+40) =2x3.14x... 1
- Find the volume of a sphere of diameter 6 cm For the sphere, diameter d=6 cm radius r= diameter/2 = 6/2 =3 Volume of sphere = 4/3π r³ = 4/33.14 x 3³ =113.04 cm³ 1
- Find the volume of a cone if the radius of its base is 1.5 cm and its perpendicular height is 5 cm. The correct Answer is 11.79 cm³ =11.79 cm³ 1
- A student uses her thumb to push a drawing pin (thumb tack) into a notice board. The pin goes into the board but does not penetrate her thumb. Answer: (D) The pressure of the pin on the notice board is greater than the pressure of the pin on her thumb. The force transmitted through... 1