Question

In: Computer Science

C++ CODE TO FIND ALL Odd numbers between 1 and 70000.

C++ CODE TO FIND ALL Odd numbers between 1 and 70000.

Solutions

Expert Solution

#include <iostream>

using namespace std;

int main()
{
    int i;
    for(i=1;i<=70000;i++)
    {
        if(i%2!=0)
        {
            cout<<" "<<i;
        }
    }
    return 0;
}

Screenshot of code

OUTPUT


Related Solutions

Write a program in C++ that computes the sum of odd numbers between 1 and 117....
Write a program in C++ that computes the sum of odd numbers between 1 and 117. Execute the program and submit a screen capture of the program and its results.
Python Exercise 2 A program is to display all odd numbers between 10 and 3000. The...
Python Exercise 2 A program is to display all odd numbers between 10 and 3000. The starting value and end value are to be assigned by the programmer, not requested from user.
Question : Write a C++ program to find all prime numbers between 10 to 100 by...
Question : Write a C++ program to find all prime numbers between 10 to 100 by using while loop. Hint: a prime number is a number that is divisible by 1 and itself. For example 3, 5, 7, 11, 13 are prime numbers because they are only divisible by 1 and themselves.
{ /* Write a program in C++ to find the perfect numbers between 1 and 500....
{ /* Write a program in C++ to find the perfect numbers between 1 and 500. The perfect numbers between 1 to 500 are: 6 28 496*/    int sum = 0;    int i = 1;    int j = 1;    for (i ; i <= 100; i++)    {        for (j; j <= 100; j++)        {            if (j < i)//Line 55            {                  ...
Write an application named OddNums that displays all the odd numbers from 1 through 99. All...
Write an application named OddNums that displays all the odd numbers from 1 through 99. All ODD numbers should show all together(Should not need to scroll down), do it in 10 rows. FOR C#
Write c code to determine if a binary number is even or odd. If it is...
Write c code to determine if a binary number is even or odd. If it is odd, it outputs 1, and if it is even, it outputs 0. It has to be less than 12 operations. The operations have to be logical, bitwise, and arithmetic.
write a code using c++. Find the first 10 prime numbers and store them in an...
write a code using c++. Find the first 10 prime numbers and store them in an array.
how to code in c# to get the total number of 1's as the numbers are...
how to code in c# to get the total number of 1's as the numbers are added in a Listbox in windows forms
(a) Use a direct proof to show that the product of two odd numbers is odd....
(a) Use a direct proof to show that the product of two odd numbers is odd. (b) Prove that there are no solutions in integers x and y to the equation 2x2 + 5y2 = 14. (c) Prove that the square of an even number is an even number using (a) direct proof, (b) an indirect proof, and (c) a proof by contradiction. Q. 2. Maximum score = 25 (parts (a) 9 points, part (b-i) and (b-ii) 8 points) (a)...
C++ Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go...
C++ Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, the 405 services the 5, and the 290 services the 90. Your program will prompt the user to type a highway number ("Please enter a highway number, Ex: 65: "), read in the number typed by the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT