0

Write program given below..

Write a program that asks the user to enter two positive integers. The program then prints a list of even and a list of odd numbers between the given integers.

1st Jul 2021, 4:23 AM
Rao Muzaffar
Rao Muzaffar - avatar
3 Respostas
0
Pls share your attempt here
1st Jul 2021, 4:29 AM
Nanda Balakrishnan
0
#include <iostream> using namespace std; int main () { int num; int min,max; cout<< "Enter a min number"; cin>> min; cout<< "Enter a max number"; cin>> max; cou<< "odd num in given range are"; for(number=min;number<=max;num++) if( num %2!=0) cout<<num<<""; cout<< "even num in given range are"; for (number=min;number<=max;num++) if (num %2==0) cout<<num<<""; return 0; }
1st Jul 2021, 4:55 AM
Rao Muzaffar
Rao Muzaffar - avatar
0
Why you write number in loop it is num
1st Jul 2021, 8:31 AM
YUGRAJ