C Programming
Computer Programming

Program in C to find the area of square using pointer



Write a Program in c to find the area of square using pointer

\* C Program to to find the area of square using pointer *\

# include < stdio.h >
int   main( )
{

float   side, area=0  ;
float   *ps, *pa  ;
printf(" Enter side of square : ") ;
scanf("%f ", & side) ;

ps = & side  ;
pa = & area  ;

area = (*ps) * (*ps)  ;
printf("\n Area of square is : %f ", *pa) ;
return ( 0 );

}

Output of Program :

Output of Program in C to find the area of square using pointer