Answer to Question #5561 in C++ for Jimmy

Question #5561
write a c++ program to print all the pelindrom number between 1 and 100 using do while do
1
Expert's answer
2011-12-09T10:53:41-0500
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
int i=8,a[100];
cout<<"1 2 3 5 7 ";
do
{
& a[i]=i;
& if (a[i]%2!=0 && a[i]%3!=0 && a[i]%5!=0 && a[i]%7!=0) cout<<a[i]<<" ";
& i++;
}
while (i<=100);
system("PAUSE");
return EXIT_SUCCESS;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS