10-27-2010
7,
0
Join Date: Sep 2010
Last Activity: 16 November 2010, 2:53 PM EST
Posts: 7
Thanks Given: 2
Thanked 0 Times in 0 Posts
Decompiler help
look, i downloaded IDA decompiler (is there a better one), its asking a whole bunch of stuff that i do not understand. how do i make this work? It asks me about a new disassembly database...what is all this
1. The problem statement, all variables and given/known data:
Write a function named isPrime which accepts one integer parameter, say x. Have the function return TRUE if x is a prime. Otherwise, have it return FALSE.
b) Write a program that keeps asking the user for an integer say k. As long as k is greater than 0, the program will call isPrime to see if k is a prime. Print the message “Prime” if it is and “Not Prime” if not. Please run p4step1.exe in the class directory for details.
Step 2: a) Modify the above program so that the user will enter two integers say x and y. As long as y > x, the program will print all primes between x and y inclusive.
b) Write a function named findPrime which accepts two integer parameters say a and b. This function will print all prime numbers from a to b by calling the function isPrime. Have your program call this function using the user input x and y. Please run p4step2.exe for details.
c) In step a) your program should have two functions main and isPrime. In step b) there should be an additional function findPrime.
I know how to write like the first step and that's it.
2. Relevant commands, code, scripts, algorithms:
1. You need to use the following functions:
a. (int) isPrime(int k),
b. (int) isPerfect( int k),
c. void findPrime(int x, int y);
d. void findPerfect(int x, int y);
e. void findSquare(int x, int y).
2. You need to use floor and ceil functions in <math.h> for finding the Square number.
3. The attempts at a solution (include all code and scripts):
int _tmain(int argc, _TCHAR* argv[])
{ int x;
int k;
printf("Enter a positive integer -->", x);
return 0;
}