Answer:
Algorithm:
1. Declare an integer variable N.
2. Read the value N from user.
3.While(N):
3.1 find r=N%10;
3.2 print r in new line.
3.3 Update N as N=N/10.
4.end program.
Implementation in C++.
// header
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variable
int N;
cout<<"Enter an Integer:";
cin>>N;
// find the digits of number
while(N)
{
// last digit
int r=N%10;
// print last digit
cout<<r<<endl;
// update the number
N=N/10;
}
return 0;
}
Output:
Enter an Integer:329
9
2
3
Cache memory
Hope it helps
Go to your general settings and click on data usage and it should show you how much storage is left.
Answer:
See explaination
Explanation:
#include <iostream>
using namespace std;
class Circle{
// private member variable named radius
private:
double radius;
// get function for radius
public:
double getRadius(){
return radius;
}
// set function for radius
void setRadius(double rad){
radius=rad;
}
// returning area = 3.14159 * radius * radius
double getArea(){
return (3.14159 * radius * radius);
}
};
// Sample run
int main()
{
// Declaring object of Circle
Circle myCircle;
myCircle.setRadius(5);
// printing radius of circle
cout<<"Radius of circle is: "<<(myCircle.getRadius())<<endl;
// printing area of circle
cout<<"Area of circle is: "<<(myCircle.getArea())<<endl;
return 0;
}