Sum of two numbers - C - A5P5



/* Write a program to find the sum of two numbers */

#include<stdio.h>
#include<conio.h>
void sum(int,int);
void main()
{
    int a,b;
    clrscr();
    printf("Enter Number 1 -> ");
    scanf("%d",&a);
    printf("Enter Number 2 -> ");
    scanf("%d",&b);
    sum(a,b);
    getch();
}
void sum(int a,int b)
{
    int sum;
    sum=a+b;
    printf("\n\nSum -> %d",sum);
}

Post a Comment