Solution:NIIT/GNIIT Sonugiri0032@gmail.com

Wednesday, January 06, 2016

WRITE A PROGRAM IN C++ TO FIND POSITIVE NUMBER IN ARRAY

WRITE A PROGRAM IN C++ TO FIND POSITIVE NUMBER IN ARRAY


Structure of the Problem Requirements 

This program will find positive number in C++ program . The Program asked user to enter some positive and negative numbers . After this the program will display that number which are greater than zero.

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<<" The Positive Numbers are : \n ";
  for (int i =0; i<7; i++)
  {
   if ( num[i]>0)
   {
    cout<<num[i]<<endl;
   }
  }
  }
Share:

0 comments:

GNIITSOLUTION GNIIT SOLUTION. Powered by Blogger.

Translate

Blog Archive

Unordered List