Anonymous

How To Find The Prime Palindrome In C++ Program Using If-else Loop?

1

1 Answers

Anonymous Profile
Anonymous answered
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;

int genpal1(int no)
{
  char buf[50];
  sprintf(buf,"%d",no);
  string oldi(buf);
  string abc;
  
  reverse(oldi.begin(),oldi.end());  
  abc=string(buf)+oldi;
  
  sscanf(abc.c_str(),"%d",&no);
  return no;
}

int genpal2(int no)
{
  char buf[50];
  sprintf(buf,"%d",no);
  string oldi(buf);
  string abc;
  oldi.erase(oldi.end()-1);
  reverse(oldi.begin(),oldi.end());  
  abc=string(buf)+oldi;
  
  sscanf(abc.c_str(),"%d",&no);
  return no;
}

bool isprime(int no)
{
  for (int k=2; k> a >> b;
  vector primes;
  for (I=1; I=a) && (l=a) && (k

Answer Question

Anonymous