Computer Science, asked by rishikeshyadav8423, 1 year ago

C program to find the square of a number using macros

Answers

Answered by surajithere
5
I hope you wil understand this program. Here I'm not used any comments because, I used simple varable names to understand. I already compiled & ran this program on my PC so, it is error-free. Read, understand & run it. Please, give me your feedback in comments. Happy to help!
Such a nice & different question...

#include<stdio.h>

#define SQUARE(INPUT) (INPUT*INPUT)
int main()
{
float input, answer;
printf("Enter the input first: ");
scanf("%f", &input);
answer = SQUARE(input);
printf("Your answer is %f", answer);
return 0;
}

surajithere: Why don't you mark it as Brainliest?
Similar questions