Found 2 Articles for C Standard Library

Array sum in C++ STL

sudhir sharma
Updated on 21-Jul-2025 18:59:36

36K+ Views

The array sum refers to the sum of all elements in an array. The STL library of C++ provides built-in functions to easily calculate the sum of elements in an array. In this article, we will explain all those STL functions with examples. Consider the following input/output scenario to understand the concept of array sum: Input: int arr[] = {1, 2, 3, 4, 5}; Output: 15 Explanation: The sum of the elements in the array is 1 + 2 + 3 + 4 + 5 = 15. Following are the different STL functions ... Read More

How to call the main function in C program?

Dev Kumar
Updated on 21-Feb-2025 16:31:12

4K+ Views

In this article, we'll discuss how to call the main() function in a C program. The main() function is the starting point and runs automatically when the program begins. However, there may be situations where you need to call it from other parts of your code. We'll explain how this works. We'll also cover recursion in the main() function and different ways to call main() within a C program. What is the Main Function? In C, the main() function is a special function that acts as the starting point of the program. Every C program must have one main ... Read More

1
Advertisements