ram khilawan


{ City } vadodra
< Country > india
* Profession * engineer
User No # 81586
Total Questions Posted # 2
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 3647

Users Marked my Answers as Correct # 7
Users Marked my Answers as Wrong # 4
Questions / { ram khilawan }
Questions Answers Category Views Company eMail

What is the algorithms of of Geographic information system project?

Image Processing Algorithms 1682

What is Rectification in image prosesing ?

Image Processing Algorithms 1965




Answers / { ram khilawan }

Question { TCS, 12829 }

Write a program that takes a 3 digit number n and finds out
whether the number 2^n + 1 is prime, or if it is not prime
find out its factors.


Answer

#include
#include

int main()
{
int i,n,num,p=1;
cout<<"enter the number";
cin>>n;
num=pow(2,n)+1;
for(i=2;i {
if(num%i==0)
{
p=0;
break;
}
}
if(p==1)
cout<<"prime";
else if(p==0)
{
cout<<"factors are";
for(i=2;i if(num%i==0)
cout< }
getch();
}

Is This Answer Correct ?    7 Yes 4 No