Завершен

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 "-".

Please enter a size: 9

- - - - - - - - -

- 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

Please enter a size: 3

- - -

- 1 -

- - -

./hourglass

Please enter a size: 7

- - - - - - -

- 1 1 1 1 1 -

- - 2 2 2 - -

- - - 3 - - -

- - 2 2 2 - -

- 1 1 1 1 1 -

- - - - - - -

./hourglass

Please enter a size: 15

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

- 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

Please enter a size: 25

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

- 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

Навыки: Программирование на С, Программирование на C#

Показать больше: website design need coding, need coding data processing, coding language personality quiz, need install language, need coding live support, need coding, mips program prompts user enter line input, need coding project, java write program prompts user enter social security, php coding language translation drupal, program prompts user input integer number equal 9in, prompts user floor selection performs input validation floor selection, write program prompts user input integer output individual digits sum digits, Coding in c language, c coding language, how to learn coding in c language, what is coding in c language, what are 3 c's in user stories

О работодателе:
( 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

Hello I already completed similar task C/C# development experience over 2 years I can help you with your assignment I have already faced similar tasks And I did them perfectly Please don't ignore me) I look forward to Больше

$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
innadevuk

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