Develop a c program to find the sum of all elements stored in a given array using a pointer.

This post content:-
Algorithm
Flowchart
C code
Output
Pdf notes

Algorithm:-
Step 1:- start.
Step 2:- declare variable I, n, sum.
Step 3:- Create a pointer variable, which points to an integer.
Step 4:- Take a size of the array as input.
Step 5:- create space for array.
Step 6:- take elements of array as input, using for Loop.
Step 7:- add all elements in a given array using pointer and for loop.
Step 8:- print the sum of all elements.
Step 9:- END.

Flowchart :- 
C code:-
Output:-
Try it yourself:- online c compiler

Comments

Popular posts from this blog

Develop a program to print values of variable and their addresses.