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;
}

Comments

Popular posts from this blog

cpanel exam CPSP Answers

How to install zimbra collaboration suite 8.8.11 on CentOS 7

awstats installation