Monday 11 August 2014

Write a Program in C++ which Find Odd Numbers in an Array

Structure of the Problem Requirements 

In this problem we will learn how to find the odd number in an array. The program will received input from the user which is numeric values . In logic there is simple function just check where the reminder is one or greater then one just print out that numbers in from a loop . Here is the source code of the problem solution which help you in better understanding .

Source Code 

#include<iostream>
using namespace std;
int main ()
{
int num [7];
for (int i =0;i<7;i++)
{
cout<<" Enter Your Number : ";
cin>>num[i];
}
cout<<endl<<endl;
cout<<" The Odd number are: \n ";
for (int i =0;i<7;i++)
{
if (num[i]%2==1)
{
cout<<endl;
cout<<num[i];
}
}
}


Output of the Program
C++ Programming
C++ Array Programming

Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

2 comments: Post Yours! Read Comment Policy!▼
Important Note:
We have Zero Tolerance to Spam. Chessy Comments and Comments with Links will be deleted immediately upon our review.

  1. I am beginner and i learn a lot of basic concept of C++ here . thanks for such a nice content

    ReplyDelete
    Replies
    1. Yes brother you learn and understand from our Programming Style... We are not add too much complexities in our Programmed

      Delete