Write a program in C++ to generate and print numbers divisible by 7 between 1 to 150.
Answers
Answered by
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
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
Math,
1 day ago
Chemistry,
1 day ago
Computer Science,
3 days ago
India Languages,
8 months ago
Social Sciences,
8 months ago
Science,
8 months ago