Square In C Programming Code Example


Example 1: square in c

#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; }

Example 2: square in c

#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; }

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable