I am trying to write a C program in linux that having sqrt of the argument, Here's the code:
#include<stdlib.h>
#include<stdio.h>
#include<math.h>
int main(char *argv[]){
float k;
printf("this is consumer\n");
k=(float)sqrt(atoi(argv[1]));
printf("%s\n",k);
return 0;
}
After I type in my input at the "shell> " prompt, gcc gives me the following error:
Segmentation fault (core dumped)