Find the absolute value of a number entered through the keyboard.

 


/*Program to calculate the absolute number

  Author:Knowledge desk, Date: November20,2020*/


#include<stdio.h>

#include<conio.h>


main()

  {

     int num;

     clrscr();

     printf("Enter the number:");

     scanf("%d",&num);

     if(num<0)

       {

  printf("Absolute number= %d",-num);

       }

     else

       {

  printf("Number is already absolute:");

       }

     getch();

     return(0);

  }

Comments