Answer:
#include <stdio.h>
int main(void) {
// Declare variables to store the number and the loop counter
int num, i;
char cont;
do {
// Prompt the user to enter a number
printf("Enter a number: ");
scanf("%d", &num);
// Print the sequence of numbers from 1 to the user-specified number
printf("Sequence: ");
for (i = 1; i <= num; i++) {
printf("%d, ", i);
}
printf("\\");
// Print the squares of the numbers from 1 to the user-specified number
printf("Squared: ");
for (i = 1; i <= num; i++) {
printf("%d, ", i * i);
}
printf("\\");
// Ask the user if they want to continue
printf("Do you want to continue? Y/N: ");
scanf(" %c", &cont);
} while (cont == 'Y' || cont == 'y');
return 0;
}