hello i want to build a programme that finds even and odd number from given two numbers. when i build it it says succeed but still it says warning C4700: uninitialized local variable 'number' used
when i debug it debug error appeared how to solve this? and can anybody tell me the reason it happens? thank you so much
below is the code
#include<stdio.h>
#include <iostream>
using namespace std;
int main(){
int number;
int firstNum,secondNum;
cout << "Enter the first number: ";
cin >> firstNum;
cout << "Enter the second number: ";
cin >> secondNum;
if(number % 2 !=0){
for(number = firstNum;number <= secondNum; number++)
cout << number<< " ";
cout << "Odd numbers in given range are: ";
cout << number<< " ";
}
else if(number % 2 ==0){
for(number = firstNum;number <= secondNum; number++)
printf("\nEven numbers in given range are: ");
cout << number << " ";
}
return 0;
}