-2
The idea is to make a program that asks the user a number, check if this number is real positive otherwise, request to type again another number, this process can repeat countless times...
cout<<"Digite um número: "<<endl;
cin>>number;
if(number % 2 == 0 ){
cout<<"O número é real positivo"<<endl;
} else {
cout<<"O número não é real positivo, por favor, digite novamente: "<<endl;
}
system("pause");
return 0;```
Hello, there are some ways to solve your problem, the most appropriate one seems to me to be that of Junior Nascimento’s answer, but as this seems to be a challenge for beginners, I imagine it would be worthwhile to see how other repeating structures work and to try to solve the same problem with them too, doing so can make you more prepared for future challenges and will surely add knowledge. I will leave a link with a good article on the subject if you are interested: Devmedia About repetition structures in c .
– Luiz Felipe Ribeiro Baroncello