Can someone show me a handmade game cabinet that they made at home? If copied from the internet I will report them I will mark brainlist
Answers
Answer:
I am making a dice number game using arrays of number and random function. In this game, time function is also used. It's just a simple program in C programming language.
1. #include<stdio.h>
2. #include<stdlib.h>
3. #include<time.h>
4. int main( )
5. {
6. char num[5] ={1,2,3,4,5};
7. srand(time(NULL));
8. int randomInt = rand() % 5;
9. printf("Your dice number is %d",num[randomInt]);
10. }
It is my homemade dice number game in C programming language.
Explanation:
Here, I am using #include<stdio.h> standard input Output library in C programming language. This standard input output library is also known as the header file of the C programming language. Standard library and time library in C programming language. Here, I am using three functions of C programming language are:
The first function is int main() which is compulsory in all C programming language. As we know that, in codechef compiler, we are writing int main() function as int main(void). There is no difference between them as you can use both of them in C programming language. The second function is srand() function which helps in choosing any of the number randomly without any instructions. These are the some functions we use in our C programed game.
Learn more from this link here:
https://brainly.in/question/277232