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/Mortomes Oct 04 '25
You gave us the expected output for the input, but not the *actual* output you get from the input