Sample Qustion 8
Write a C++ program to find the all the composite numbers below 100.
#include<iostream>
using namespace std;
int main()
{
int i,n,factor;
for(n=2;n<=100;n++)
{
for(i=1;i<n;i++)
{
if(n%i==0)
{
factor=i;
}
}
if(factor>1)
{
cout << n <<endl;
}
}
return 0;
}
download file cpp file
do you have any qustion please comment
click the advertisement to help for me ....
#include<iostream>
using namespace std;
int main()
{
int i,n,factor;
for(n=2;n<=100;n++)
{
for(i=1;i<n;i++)
{
if(n%i==0)
{
factor=i;
}
}
if(factor>1)
{
cout << n <<endl;
}
}
return 0;
}
download file cpp file
do you have any qustion please comment
click the advertisement to help for me ....
Comments
Post a Comment