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

plz tell me the solution.......... in c language program guess any one number from 1 to 50 and tell that number within 8 asking question in yes or no...............

2 Answers   Wipro,


PROG. TO PRODUCE 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1

1 Answers  


Design an implement of the inputs functions for event mode

0 Answers   Wipro,


C program to print magic square of order n where n > 3 and n is odd

2 Answers   Accenture,


void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }

1 Answers  






Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

2 Answers  


#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }

3 Answers   Hexaware,


What is the main difference between STRUCTURE and UNION?

13 Answers   HCL,


void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }

1 Answers  


Write a C function to search a number in the given list of numbers. donot use printf and scanf

5 Answers   Honeywell, TCS,


What is full form of PEPSI

0 Answers  


main() { show(); } void show() { printf("I'm the greatest"); }

2 Answers  


Categories