Answer:
C++ Program to Find Area and Circumference of a Circle
Area of Circle = PI X Radius X Radius. Where, Where PI is a constant which is equal to 22/7 or 3.141(approx)
Circumference or Circle = 2 X PI X Radius.
Circumference or Circle = PI X Diameter.
Explanation:
Answer:
void print2(int row) {
for (int i = 0; i < row; i++) {
char ch = 'a';
char print = ch;
for (int j = 0; j <= i; j++) {
cout << print++;
}
cout << endl;
}
}
int count_digits(int num) {
int count = 0;
int temp = num;
while (temp != 0) {
temp = temp / 10;
count++;
}
return (num % count);
}
Explanation:
Answer:
#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n)
{
for(int j=2;j<=n-1;j++) //loop to check prime..
{
if(n%j==0)
return false;
}
return true;
}
int main(){
int n;
cout<<"Enter the integer"<<endl;//taking input..
cin>>n;
if(isPrime(n))//printing the message.
{
cout<<"The number you have entered is prime"<<endl;
}
else
{
cout<<"The number is not prime"<<endl;
}
return 0;
}
Output:-
Enter the integer
13
The number you have entered is prime
Explanation:
The above written program is in C++.I have created a function called isPrime with an argument n.I have used a for loop to check if the number is prime or not.In the main function I have called the function isPrime for checking the number is prime or not.
Answer:
-Both need oxygen from the trees to breathe
-Without trees the population of animals and people would be dying
Explanation:
Thats all I can think of
Def firstChars( word ):
if( word ): # make sure word has characters
print( word[ 0 ] ) # print the first character (Python 3 syntax)