write a program in c++ to print all the 3 digit numbers
Answers
Answered by
1
Answer:
don't use C++, but I can give the function in C, you can replace printf statements with the cout. I'm considering that you have already taken the number as input. Just modify the function and call it.
void func(int n){
int third = n % 10;
n /= 10;
int second = n % 10;
n /= 10;
int first = n % 10;
n /= 10;
printf("%d\n%d\n%d", first, second, third);
}
Similar questions