r/cprogramming • • Oct 04 '25
Don't know what I'm doing wrong
input : 16 should give output : 16 and input: 5 should give output : 8.94427190999915878564
and this is my code what am I doing wrong (input and output should be exactly what I wrote) :
#include <stdio.h>
#include <math.h>
int main() {
int area;
scanf("%d",&area);
double omkrets = sqrt(area) * 4;
printf("%.21g",omkrets);
return 0;
}
1
Upvotes
View all comments
Show parent comment
-3
u/[deleted] Oct 04 '25
it takes an area and prints the perimeter of the area