forked from ayush-8/C_programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1Day.txt
More file actions
35 lines (24 loc) · 838 Bytes
/
1Day.txt
File metadata and controls
35 lines (24 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
A) Write a program to produce the following output:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Do not Hard Code, i.e., do not use directly printf function.
B)Write a program to print the multiplication table of the
number entered by the user. The table should get displayed in
the following form.
29 * 1 = 29
29 * 2 = 58
......
c)Write a program to check if the entered number is a prime number.
D)Write a program for a matchstick game being played between
the computer and a user. Your program should ensure that the
computer always wins. Rules for the game are as follows:
− There are 21 matchsticks.
− The computer asks the player to pick 1, 2, 3, or 4
matchsticks.
− After the person picks, the computer does its
picking.
− Whoever is forced to pick up the last matchstick
loses the game.