C Online Compiler
Example: Sum of Two Numbers in C using Function
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// Sum of Two Numbers in C using Function #include <stdio.h> // This function will return sum of two integer numbers int Sum(int a, int b) { return a + b; } // It's the driver function int main() { int p, q; printf("Enter two integer values::\n"); scanf("%d %d", &p, &q); printf("Result:: %d + %d = %d\n", p, q, Sum(p, q)); return 0; }
5 7
Output
Clear
ADVERTISEMENTS