Thursday, 16 October 2014

Write a program that reads 10 numbers from the user into an array and tells how many of them multiples of 6 are

Leave a Comment
#include<iostream>
using namespace std;
void main()
{
    int counter=0,temp=0;
    float numbers[10];
    for(int i=0;i<10;i++)
        {
            cout<<"Please Enter Value  = ";
            cin>>numbers[i];
            temp=numbers[i];
            temp=temp%6;
            if(temp==0)
                {
                    counter++;
                }
    }
    cout<<"Total Multiples of 6 = "<<counter<<endl;
    system("pause");
}
Output:
If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: