This c program add n numbers which will be entered by the user. Firstly user will enter a number indicating how many numbers user wishes to add and then user will enter n numbers. In the first c program to add numbers we are not using an array, and using array in the second code.
C programming code
You can use long int data type for sum variable.
Output of program:
Output of program:
No comments:
Post a Comment