x

Choose Country Code

x

Direction

x

Ask a Question

  • Ask a Question
  • Scan a Question
  • Post MCQ
  • Note: File extension must be of jpg, jpeg, png, bmp format and file size must not exceed 5 MB
x

Ask a Question

x

x
x
x
Hire a Tutor

Answers and Solutions

What's Your Question?
Answer

Example of user defined macros: 

#define max( a, b) a > b ? a : b

we can use max(100,2) where ever we want to use this macro

 

#include <stdio.h> #define charout( c ) fputc(c,stdout) int main() { char text[] = "Hello, there!\n"; int x = 0; while(text[x]) { charout(text[x]); x++; } return(0); }

used macro : fputc(text[x],stdout);

 

Post Answer and Earn Credit Points

Get 5 credit points for each correct answer. The best one gets 25 in all.

Post Answer