Question #302602

Write a C program to perform the arithmetic operation. Here, the preprocessor replaces "printf" in place of "out" and "scant" in place of "in" before compilation of program. Therefore, the word can be defined as macro. Note** #define out printf** #define in scanf.


Input:



6.5



3.3



Output:



9.8

Expert's answer

#include <stdio.h>

#define out printf
#define in scanf

int main()
{
    float n1, n2;    
    out("Enter number a: ");
    in("%f", &n1);        
    out("Enter number b: ");
    in("%f", &n2);    
    out("\nOutput:\n");
    out("%.1f\n", n1+n2);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS