# Assignment 5: Arrays Solution

\$30.00

Category:

## Description

Programs:

1. Write a program to sort the elements in an array in ascending order. Take the input array from the user and use loops to sort the elements.

The desired output is:

Enter the value of N

8

Enter the numbers

12

23

45

66

78

56

44

44

The numbers arranged in ascending order are given below

12

23

44

44

45

56

66

78

1. Write a program to find the sum of elements of an array which is equal to the target sum. You need to enter array elements and a target element from the user and find which of those elements would sum equal to the target element. You must print the index and value of those elements. The desired output is:

Enter 5 elements for the array

10

12

2

8

4

Enter a target element for sum

14

The target index is a[0]=10 and b[4]=4

The target index is a 1 =12 and b 2 =2

1. Write a program that reverses the words in a sentence using arrays:

Enter a sentence: you can cage a swallow can’t you?

Reversal of sentence: you can’t swallow a cage can you?

Write pseudocode to solve the given problems.

Write C program to solve the above problems. Name your file Lab5_YourName.c

error: Content is protected !!