Write a program that reads 10 integers from user and then finds and prints all the Odd numbers that are divisible by 5.
#include <iostream>
using namespace std;
int main()
{
int n[10],i;
cout<<"Enter 10 integers: "<<endl;
for(i=0;i<10;i++)
{
cin>>n[i];
}
cout<<"The Odd numbers that are divisible by 5."<<endl;
for(i=1;i<10;i++)
{
if(n[i]%5==0)
{
cout<<n[i]<<endl;
}
}
return 0;
}
Comments
Leave a comment