Program to add two integers using structure and function

Program to add two integers using structure and function

#include<stdio.h>
struct addition
{
int a, b;
};
void add(int a, int b)
{
int c;
c = a + b;
printf (“Sum =%d”, c);
}
void main( )
{
struct addition p;
printf(“Enter two integers\n”);
scanf(“%d%d”, &p.a, &p.b );
add(p.a, p.b );
}

Comments