Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int function ( int N)
- {
- int Sum = 0;
- while (N>0)
- {
- Sum += (N % 10);
- N/=10;
- }
- return Sum;
- }
- void Count ( int a, int b)
- {
- int g;
- for ( int i=a; i<=b; i++)
- {
- g = function (i);
- if ( g % 2 == 1)
- cout << i << " ";
- }
- }
- int main ()
- {
- int a;
- int b;
- cout << " Enter numbers: ";
- cin >> a >> b;
- Count( a, b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement