Skip to main content
Search
Search This Blog
Livecodo
Pages
Home
Courses
Blog
About us
More…
Share
Get link
Facebook
X
Pinterest
Email
Other Apps
March 30, 2024
Create a C program to perform arithmetic operations using macros.
#include
#define ADD(a,b) a+b #define SUB(a,b) a-b #define MULTIPLY(a,b) a*b #define DIVIDE(a,b) a/b int main() { int a=10,b=5; printf("addition value is %d\n",ADD(a,b)); printf("Sub value is %d\n",SUB(a,b)); printf("multiply value is %d\n",MULTIPLY(a,b)); printf("divide value is %d\n",DIVIDE(a,b)); }
Popular Posts
March 26, 2024
Dynamic Memory allocation in C
May 18, 2024
Searching and sorting Algorithm in C