Author: Micheal

C++ Program to use endl and setw() Manipulators.

#include <iostream.h> #include <conio.h> #include <iomanip.h> void main() { clrscr(); int x = 12, y = 123, z = 1234; cout << "Without using setw() :"<< endl; cout << x << endl; cout << y << endl; cout << z << endl; cout << "\n With using setw() :"<< endl; cout << setw(7) << x … Continue reading C++ Program to use endl and setw() Manipulators.

Advertisements

C++ Program to Calculate the volume of Cylinder and Explain Comments in C++

/* This program is used to explain Multiple line Comment and single line comment */ #include <iostream.h> #include <conio.h> void main() { clrscr(); float r, h, v;   //variable Declaration. cout << "\nEnter Radius & Height of a Cylinder : : "; cin >> r >> h;   //Reading data from Keyboard. v = 3.14*r*r*h; … Continue reading C++ Program to Calculate the volume of Cylinder and Explain Comments in C++