Ask user to enter a random number between 1 and 100. Then ask how many numbers s/he wants to display that precedes first number s/he enters.
if user enter 9 and wants 3 numbers that precedes 9, your program should display this:
6 7 8 9
I can not finish it.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int endnum, pre;
printf("Enter a random number between 1 and 100: ");
scanf("%d", &endnum);
printf("how many numbers he wants to display that precedes first number you entered: ");
scanf("%d", &pre);
num = endnum - pre;
printf (%d, num+1)
num = num + 1
while (num <= endnum)
return 0;
}