Write a program to find the square of a number using pre-processor. | CODE WITH SHARAD

Write a program to find the square of a number using pre-processor.

Written by Sharad Raj on 13th of March, 2018

BASIC PROGRAMS   C LANGUAGE PROGRAMS

PROGRAM CODE

#include<stdio.h>

#include<conio.h>

#define SQUARE(x) x*x

void main()

{

int a,b;

clrscr();

printf("enter the number to square : ");

scanf("%d",&a);

b=SQUARE(a);

printf("the square of %d is %d",a,b);

getch();

}


Comments


Contact