# Need someone can do the coding in language c -- 3

project 1

Write a program called hourglass.c that prompts the user to enter an integer n and prints an nxn pattern containing an hourglass. This hourglass will contain positive integers that decrease from the middle, all surrounded by hyphens "-".

- - - - - - - - -

- 1 1 1 1 1 1 1 -

- - 2 2 2 2 2 - -

- - - 3 3 3 - - -

- - - - 4 - - - -

- - - 3 3 3 - - -

- - 2 2 2 2 2 - -

- 1 1 1 1 1 1 1 -

- - - - - - - - -

You can assume n is odd and >= 3.

Make your program match the examples below exactly.

This exercise is designed to give you practice with while loops and if statements. Do not use arrays for this exercise!

Note: you are not permitted to use an array in this exercise.

./hourglass

- - -

- 1 -

- - -

./hourglass

- - - - - - -

- 1 1 1 1 1 -

- - 2 2 2 - -

- - - 3 - - -

- - 2 2 2 - -

- 1 1 1 1 1 -

- - - - - - -

./hourglass

- - - - - - - - - - - - - - -

- 1 1 1 1 1 1 1 1 1 1 1 1 1 -

- - 2 2 2 2 2 2 2 2 2 2 2 - -

- - - 3 3 3 3 3 3 3 3 3 - - -

- - - - 4 4 4 4 4 4 4 - - - -

- - - - - 5 5 5 5 5 - - - - -

- - - - - - 6 6 6 - - - - - -

- - - - - - - 7 - - - - - - -

- - - - - - 6 6 6 - - - - - -

- - - - - 5 5 5 5 5 - - - - -

- - - - 4 4 4 4 4 4 4 - - - -

- - - 3 3 3 3 3 3 3 3 3 - - -

- - 2 2 2 2 2 2 2 2 2 2 2 - -

- 1 1 1 1 1 1 1 1 1 1 1 1 1 -

- - - - - - - - - - - - - - -

./hourglass

- - - - - - - - - - - - - - - - - - - - - - - - -

- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -

- - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - -

- - - 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 - - -

- - - - 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 - - - -

- - - - - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - - - - -

- - - - - - 6 6 6 6 6 6 6 6 6 6 6 6 6 - - - - - -

- - - - - - - 7 7 7 7 7 7 7 7 7 7 7 - - - - - - -

- - - - - - - - 8 8 8 8 8 8 8 8 8 - - - - - - - -

- - - - - - - - - 9 9 9 9 9 9 9 - - - - - - - - -

- - - - - - - - - -1010101010 - - - - - - - - - -

- - - - - - - - - - -111111 - - - - - - - - - - -

- - - - - - - - - - - -12 - - - - - - - - - - - -

- - - - - - - - - - -111111 - - - - - - - - - - -

- - - - - - - - - -1010101010 - - - - - - - - - -

- - - - - - - - - 9 9 9 9 9 9 9 - - - - - - - - -

- - - - - - - - 8 8 8 8 8 8 8 8 8 - - - - - - - -

- - - - - - - 7 7 7 7 7 7 7 7 7 7 7 - - - - - - -

- - - - - - 6 6 6 6 6 6 6 6 6 6 6 6 6 - - - - - -

- - - - - 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 - - - - -

- - - - 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 - - - -

- - - 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 - - -

- - 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 - -

- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -

- - - - - - - - - - - - - - - - - - - - - - - - -

project 2

Write a program called loop_sum.c that reads an integer n from standard input, and then scans in n integers from standard input, adds them together, then prints the sum.

You can assume that n is non-negative (≥ 0).

You can assume that you are given exactly n+1 integers.

You can assume that scanf succeeds (you do not need to check for errors).

Make your program match the examples below exactly.

Note: you are not permitted to use an array in this exercise.

dcc loop_sum.c -o loop_sum

./loop_sum

How many numbers: 2

1

2

The sum is: 3

How many numbers: 3

-3

4

13

The sum is: 14

How many numbers: 5

-2

-1

0

1

2

The sum is: 0

О работодателе:
( 4 отзыв(-а, -ов) ) Adelaide, Australia

ID проекта: #30655447

## Поручен:

nazzrrg

Once I had to write an archiver in C. I believe can create this for you in 2hrs time and explain everything in detail. Even code this live if you prefer so. Refer to [login to view URL] Больше

\$25 AUD за 1 день
(0 отзывов(-а))
0.0

## 7 фрилансеров(-а) готовы выполнить эту работу в среднем за \$22

lechaantonov333

Hi I have a good skill in C/C++, C#, JAVA programing. I have finished many projects using C/C++, C#, JAVA. I can do it perfectly in your timeline. Let's discuss more details in private chat. Thanks.

\$20 AUD за 7 дней(-я)
(2 отзывов(-а))
3.1
gryndanya

\$20 AUD за 1 день
(10 отзывов(-а))
2.2
bmoatar1

Hi, I have full experience with C ========================================================== I can carry out your project on time with high quality guarantee. I hope to discuss more in detail. Best regards.

\$20 AUD за 1 день
(1 отзыв)
0.0

Hi, dear! I already read your requirement in detail and very interesting for this project. I am a senior application developer with c++, python and java so I can help you for sure in your project. And I will provide th Больше

\$20 AUD за 1 день
(0 отзывов(-а))
0.0
ant0504

Hi, I've read your description carefully. I have more than 10 years experience with c. ************************************************************************************* I'm confident in your project with high quali Больше

\$20 AUD за 1 день
(0 отзывов(-а))
0.0
tiamaevdmitrii

hI, i c# and c++ expert. I can make your hourglass app as you want within hour. Hope to discuss more details. Regards.

\$30 AUD за 1 день
(0 отзывов(-а))
0.0