#include <stdio.h>
int main() {
int a=-4, b;
/* Some code which initializes "a" here ... */
if (a < 0) {
a = -a;
}
b = sqrt (a);
printf("%d",b);
return 0;
}
yes code will always work. But will not give correct output everytime. Like for - 4 it is giving square root as 2. But it is not a correct result