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 |
Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }
Cluster head selection in Wireless Sensor Network using C programming language.
Write a C function to search a number in the given list of numbers. donot use printf and scanf
void main() { printf(“sizeof (void *) = %d \n“, sizeof( void *)); printf(“sizeof (int *) = %d \n”, sizeof(int *)); printf(“sizeof (double *) = %d \n”, sizeof(double *)); printf(“sizeof(struct unknown *) = %d \n”, sizeof(struct unknown *)); }
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }
Is the following code legal? struct a { int x; struct a *b; }
Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.
main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }
Find your day from your DOB?
15 Answers Accenture, Microsoft,
print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
35 Answers Tata Elxsi, TCS, VI eTrans,