#include <math.h>
int main()
{
float number;
square = pow(number,2); //This returns number raised to the power 2
printf("The square of %f is %f", number, square);
return 0;
}
Are you beginner in problem solving?
Let's Solve 200 Beginner level problems with explanation video:
https://cutt.ly/200-Problems-interactive-coding-pdf
#include <stdio.h>
#include <math.h>
void main(){
int num, result;
printf("Enter a number: ");
scanf("%d",&num);
result = sqrt(num);
printf("Square root of %d = %d",num,result);
}
#include <stdio.h>
int main()
{
float number;
printf("Enter a number: ");
scanf("%f", &number);
square = number * number;
printf("square of the given number %f is %f", number, square);
return 0;
}