Answer to Question #266074 in C++ for DANISH

Question #266074

Write a program that reads 10 integers from user and then finds and prints all the Odd numbers that are divisible by 5.



(Please Only DO it by IF-Else or Nested if else) (not by loops)

1
Expert's answer
2021-11-15T00:23:00-0500
#include <bits/stdc++.h>


using namespace std;


int arr[10];


int main()
{
  for (int i = 0; i < 10; i++)
  {
    cin >> arr[i];
  }
  for (auto x : arr)
  {
    if (x % 2 == 1 && x % 5 == 0)
      cout << x << '\n';
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS