Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

#include <iostream>

using namespace std;

// Assign c's value to a, a's value to b and

// b's value to c.

void swapTwo(int &a, int &b, int &c)

c = a;

a = b;

b = c;

int main()

int a = 5, b = 7,c;
cout << "Before swapping a = " << a << ", b = "

<< b << ", c = " << c << endl;

swapTwo(a, b,c);

cout << "After swapping a = " << a << ", b = "

<< b << ", c = " << c << endl;

return 0;

#include <iostream>

int main()

float radius, area;

std::cout << "Enter the radius of circle : ";

std::cin >> radius;

area = 3.14 * radius * radius;

std::cout << "Area of circle with radius "

<< radius << " is " << area;

return 0;

}
#include <iostream>

int main()

float E,m,c;

int res;

std::cout << "Enter the value of m : ";

std::cin >> m;

c=3000;

res=sqrt(c);

E=m*res;

std::cout << "Energy is E: "<< E;

return 0;

You might also like