#include<iostream.h>
#include<conio.h>
int main(){
int number;
int min,max;
cout << "Enter the minimum range: ";
cin >> min;
cout << "Enter the maximum range: ";
cin >> max;
cout << "Odd numbers in given range are: ";
for(number = min;number <= max; number++)
if(number % 2 !=0)
cout << number;
return 0;
}
OUTPUT
Enter the minimum range:2
Enter the maximum range:10
Odd numbers in given range are:3 5 7 9
#include<conio.h>
int main(){
int number;
int min,max;
cout << "Enter the minimum range: ";
cin >> min;
cout << "Enter the maximum range: ";
cin >> max;
cout << "Odd numbers in given range are: ";
for(number = min;number <= max; number++)
if(number % 2 !=0)
cout << number;
return 0;
}
OUTPUT
Enter the minimum range:2
Enter the maximum range:10
Odd numbers in given range are:3 5 7 9
No comments:
Post a Comment