+ 1
I need to make an programm which prints out the given digit of a given number
Example: input: m=2345 n=3 output: 5 also the programm should repeat itself. I got the most so far but i dont know how i can print out the fourth (5) number of m. Thank you guys
4 Respostas
+ 5
It would be helpful if you show us the code you have done so far.
+ 1
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
bool run {true};
while (run)
{
double m{0},n{0};
cout<< "Type in number= ";
cin>> m;
cout<< "Digit of the number?= ";
cin>> n;
//Give out Digit(n) of the number(m);
char answer;
cout<< "Run Programm again? [y/n]: ";
cin>> answer;
run = answer == 'y';
}
return 0;
}
+ 1
I dont think we use arrays yet we just learned loops.