Write c++ program for the following using function :Dr. Strange has an experimental laboratory in a mysterious enclave. He is conducting an experiment to strange genes which will make him the most powerful sorcerer in the existence . He needs to create particular amount of bacteria. The bacteria multiplies exponentially. If he lets m bacteria to multiply n exponential times, he should check whether he will get the required amount of bacteria. Input consists of three inputs. The no. of bacteria, m. The number in which it gets multiplied, n. The required number, req .
Answers
Answered by
8
Answer:
#include<iostream>
#include<math.h>
using namespace std;
int armstrong();
int armstrong()
{
int n, p, q;
cin>>n>>p>>q;
int a=pow(n,p);
if(a>=q)
{
return true;
}
else
{
return false;
}
}
int main()
{
if(armstrong()==1)
{
cout<<"Doctor, you can proceed with your experiment."<<"\n";
}
else
{
cout<<"Sorry Doctor! You need more bacteria.";
}
}
Explanation:
Answered by
4
Answer:
#include<iostream>
#include<math.h>
int main()
{
int a,b,c;
std::cin>>a;
std::cin>>b;
std::cin>>c;
int m=pow(a,b);
if(m>=c)
{
std::cout<<"Doctor, you can proceed with your experiment.";
}
else
{
std::cout<<"Sorry Doctor! You need more bacteria.";
}
}
Explanation:
Similar questions
India Languages,
5 months ago
English,
5 months ago
Social Sciences,
11 months ago
Computer Science,
11 months ago
Environmental Sciences,
1 year ago
Science,
1 year ago