c program to add two integers by passing arguments to function using pointers

#include<stdio.h>
void sum(int *a,int *b,int *t);//fn declaration
int main()

{
int num1,num2,total;
printf(“n Enter first number”);
scanf(“%d”,&num1);
printf(“Enter the second number”);
scanf(“%d”,&num2);
sum( &num1,&num2,&total);//fn calling
printf(“n the sum total is %d”,total);
return 0;
}
//fn definition
void sum(int *a,int *b,int *t) // fn
{
*t=*a+*b;
}

Leave a Comment

Your email address will not be published. Required fields are marked *

To Resolve this issue at just 5$ from ServerExpert

https://serverexpert.io/

For Hosting please visit Hostingwebsite.io

You have Successfully Subscribed!

Open chat