skip to main
|
skip to sidebar
\Spam
Wednesday, November 26, 2008
Addition in C using a macro
#include
#include
#define add(a,b) a+b //defining the macro
void main()
{
int x,y,sum;
clrscr();
printf("enter the 2 numbers for addition\n");
scanf("%d\n%d",&x,&y);
sum = add(x,y); //using it here
printf("\ntheir sum is %d",sum);
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Google Search
Youtube
Watch the latest videos on YouTube.com
Ads
Ads
Counter
Followers
Blog Archive
►
2009
(1)
►
March
(1)
▼
2008
(2)
▼
November
(2)
Addition in C using a macro
Finding Factorial (Code for Borland C) using recur...
No comments:
Post a Comment