#include <iostream>
using namespace std;
// code for user to enter value any number , if multiple of 10, code stops in C++
int main(){
int num;
do{
cout << "enter a number : ";
cin >> num;
if(num % 10 == 0){
break;
}
cout << "you entered " << num << endl;
} while(true); // this is a infinite loop of do-while loop (code is excluded)
cout << "you entered a multiple of 10 number. byeee....";
return 0;
}
No comments:
Post a Comment