Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

help!!!!!

#include <iostream>

using namespace std;

int main()
{
    int i, j, flag,D[10],m=0,l;
    int C[]={78, 73, 90, 88, 87, 86, 41 ,62, 61, 50};
  for(i=0;i<10;i++)
    {
     flag=0;
        for(j=2;j<C[i];j++)
        {
            cout<<C[i]<<"\n";
            if(C[i]%j==0)
                flag=1;
                break;
        }
     if(flag==0)
     {
         D[m]=C[i];
            m++;
     }
 }
  for(i=0;i<m;i++)
     {
     cout<<D[i]<<" ";
     } 
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.