PROGRAM TO INPUT A NO. AND IF THE NO.IS ODD THEN PRINT THE SQUARE ROOT ELSE PRINT n TO THE POWER 5


#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
long int n;

float s=0.0;
  clrscr();

printf("enter a number");
scanf("%ld",&n);

if(n<=0)
printf("WRONG INPUT");

else
{
if(n%2!=0)
{

 s=pow(n,0.5);
 printf("%f",s);

 }
else
 {
 s=pow(n,5);
  printf("%f",s);

 }
}
 getch();

 }

SIMPLE PROGRAMS
FUNCTIONS


NUMBERS


STRINGS AND CHARACTERS

Comments