About 12,000,000 results
Open links in new tab
  1. Sum of Two Numbers in C using Function - W3CODEWORLD

    May 13, 2022 · In this article, you will learn how to find sum of two numbers in c using function, pointers, array, and recursion with and without minimum variables. Result:: 5 + 7 = 12. int p, q, r; printf ("Enter two integer values::\n\n"); scanf ("%d %d", &p, &q); // calculating sum . r = p + q; . printf ("Result:: %d + %d = %d\n", p, q, r); return 0;

  2. C Program for Addition of Two Numbers Using Functions

    To add two numbers, first of all, numbers should be passed to the addition() function. The addition() function takes two arguments, store it in parameter variables, calculate the sum of both numbers and returned results to the main function.

  3. C Program to Add Two Integers - GeeksforGeeks

    Jan 10, 2025 · In C, we can add two numbers easily using addition operator (+). This operator works by taking two operands and returns their sum as the result. Output. Explanation: In the above program, the user is first asked to enter two numbers. The input is taken using the scanf () function and stored in the variables a and b.

  4. Addition using functions examples in C - Tutor Joes

    This program is a C program that performs the addition of two numbers using a function. The header file "stdio.h" is included, which contains the standard input/output library functions. The "void add()" function is declared, which will perform the addition of two numbers.

  5. Program in C to add two numbers using function (Pass by value …

    Apr 9, 2010 · The below program in C accepts 2 integer numbers and calculates the sum of those 2 numbers using add function. add function accepts two integer parameters namely nos1 and nos2. This function then calculates the sum and return the result to the calling main function.

  6. C Program to Add two numbers - BeginnersBook

    Jul 22, 2022 · In this tutorial, you will learn how to write a C program to add two numbers. This is a very basic C program where user is asked to enter two integers and then program takes those inputs, stores them in two separate variables and displays the sum of these integers.

  7. Sum of two numbers in C using function - Code Revise

    In this example code, you will learn to make sum of two numbers in c using function. Sum of two numbers is the basic program to add the values of two numbers and print addition as result in c language. for example: a = 5, b = 10; sum = a + b; Output. Sum = 9. Check out our other C programming Examples.

  8. Program to Sum of Two Numbers in C using a Function

    Write a program to Sum of Two Numbers in C using a Function. This program is to understand how functions work in c language. The program accepts two numbers from the user and calculates the sum of those numbers.

  9. How to Add Two Numbers in C: A Step-by-Step Guide to Functions

    Here’s a simple C program that adds two numbers using a function: How Does the Code Work? Function Declaration: We declare a function add that takes two integer arguments, num1 and num2, and returns an integer value. Function Definition: Inside the add function, we simply return the sum of num1 and num2. Main Function:

  10. C Program To Add Two Numbers Using Functions/Pointer - C

    C program to add two numbers using function: #include<stdio.h> #include<conio.h> int add(int a,int b); //function declaration void main() { int sum,x,y; clrscr(); printf("\n Enter Any Two Numbers To Add : "); scanf("%d%d",&x,&y); sum=add(x,y); //calling the function printf("\n Addition = %d",sum); getch(); } int add(int a, int b) //definition ...

  11. Some results have been removed