Answer to Question #302602 in C for Suvedhaa

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

1
Expert's answer
2022-02-25T03:39:26-0500
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS