how to get user input in c

To get user input in C, you can use the scanf() function to read input from the standard input (keyboard). Here's an example:

#include <stdio.h>

int main() {
    int num;
    printf("Enter a number: ");
    scanf("%d", &num);
    printf("You entered: %d", num);
    return 0;
}