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
Answer / anuj
compile the code by writing this command
gcc filename.c -lm
| Is This Answer Correct ? | 2 Yes | 2 No |
write a c-program to display the time using FOR loop
main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }
void main() { int i=5; printf("%d",i+++++i); }
write a c program to print magic square of order n when n>3 and n is odd?
What is data _null_? ,Explain with code when u need to use it in data step programming ?
How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;
main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); printf("%f\n",f<<2); printf("%lf\n",f%g); printf("%lf\n",fmod(f,g)); }
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }