Write a C program that performs the task described below. Name your c file as nameSurnameId_tasknumber.c [ex: seydanurAhi171561011_1.c]
Upload your file to your sections submission page on moodle.
Arrays in C special data structure which is used for list of values, manipulation of memory space.
Tasks:
- C program to draw a perpendicular triangle with *.
Ex:
*
**
***
****
*****
- C program to draw pyramid with *. Ex height 4:
*
***
*****
*******
Hint: According to bottom line, find the number of blank characters at the first line(how many blank is at right side and how many blank is at left side?). If height of pyramid is 4, then bottom line has got 7 asterix ((4-1)*2+1). First line has got 6 blank (4-1 left side and 4-1 right side) characters and one Asterix (at the middle.
- C program to print all the composite numbers from 2 to a certain number entered by user.
Enter a number:15
4 is composite 6 is composite
- is composite
- is composite
- is composite
12 is composite
- is composite
- is composite
Hint: A composite number (bileik say) is a positive integer that can be formed by multiplying two smaller positive integers.
Reviews
There are no reviews yet.