How to use power function under linux environment.eg :
for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined
reference to 'pow'.

Answers were Sorted based on User's Feedback



How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it ..

Answer / anuj

compile the code by writing this command
gcc filename.c -lm

Is This Answer Correct ?    2 Yes 2 No

How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it ..

Answer / seema

thank you !!!!!!!!!!!!IT work...!:) :D

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Code Interview Questions

main() { main(); }

1 Answers  


what is oop?

3 Answers  


What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }

1 Answers  


void main() { int c; c=printf("Hello world"); printf("\n%d",c); }

2 Answers  


&#8206;#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }

2 Answers  






void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }

1 Answers  


how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

0 Answers   Mbarara University of Science and Technology,


main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }

1 Answers  


main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }

1 Answers  


{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

4 Answers  


func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !\n ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }

1 Answers   Satyam,


#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }

1 Answers  


Categories