having trouble solving a program

This is a discussion on having trouble solving a program within the C Programming forums, part of the General Programming Boards category; Hi all, i was having trouble solving this question:
Write a C program that displays all numbers from 1 to ...

1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

how do i test if a no. divided a no. gives an int not a float value ? do i use the % ? help plz

Yes you use %. A number is divisible by another number if the remainder of the division of that number by the second number is 0. Test for that in an if statement inside your for loop and you are done.

1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.