Computer Science, asked by vandhana6482, 11 months ago

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 raushanbaba96
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 parthik1999
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