Can you give more details of your assignment? Are you supposed to be identifying prime numbers in [1,x]? Or are you supposed to be printing whether or not each digit is evenly divisible into x (considering the cnt variable's apparent intent)?
BTW, your for statement should look like this for (i = 1; i <= x; i++)
when input a number, all number will be place and it will be determine whether it is prime or composite. 0
Just like this: when i input 7, the output will be:
input a number: 7
the output will be
Input Number: 7
1 >> PRIME
2 >> PRIME
3 >> PRIME
4 >> COMPOSITE
5 >> PRIME
6 >> COMPOSITE
7 >> PRIME
Press any key to continue..
What you'll prerequisitely need is an understanding of the algorithm to determine whether a number is prime or not, or else i cannot see you doing this piece of homework.
Then you check each number to see if it is prime. If it is not prime, then it's got to be composite!
I posted a piece of code to your post of the "largest prime number"...you'll get the algorithm of determining whether a number is prime or not there.