Computer Science, asked by pintuhardware81, 3 days ago

Write a program in C++ to generate and print numbers divisible by 7 between 1 to 150.

Answers

Answered by jyothiketha16
1

Answer:

include<bits/stdc++.h>

using namespace std;

int Num(int n);

{

for(int j=1,j<n+1,j++)

{

if(j%5==0 || j%7==0)

cout<<j<<" ";

return n;

}

int main()

{

int n = 50;

Num(n);

return 0;

}

Answered by monica789412
0

Cpp program to generate and print all the numbers between 1 to 150 that are divisible by 7.

#include<iostream>

using namespace std;

int main(){

   cout<<"All the numbers divisible by 7 between 1 to 150 are:"<<endl;

   for(int i=1; i<=150; i++) {

       if(i%7==0){

           cout<<i<<" ";

       }

   }

   return 0;

}

Similar questions