write to program to store 100 random numbers in array and store all the numbers which are multiples of 7 in another arry.print both
1
Expert's answer
2012-12-20T07:38:56-0500
#include <iostream> #include <conio.h> #include <time.h> using namespace std;
//main function int main() { srand (time (NULL)); int arraofnumbers[100]; int arraofnumbersmod7[100]; for(int i=0;i<100;i++){ arraofnumbers[i]=rand()1; } int count=0; for(int i=0;i<100;i++){ if(arraofnumbers[i]%7==0){ arraofnumbersmod7[count]=arraofnumbers[i]; count++; }
Comments
Leave a comment