cGenerate a random number
#include <stdlib.h> #include <time.h> srand(time(NULL)); int x = rand() % 100;ctrl + c
Set the seed of rand function to generate the random number from the actual time of system
Generate a random number between 0 and 99
More of C
- Set a value to every byte of an array
- Concatenate two strings
- How to get the execution time of functions
- Get the square root of a number
- Get the length of a string
- Conditional using ternary operator
- Copy one string to another
- Swapping two variables values using the logical operator XOR
- Get the round of a float number
- How to find the sum of all the elements of an integer array?
See more codes...