#define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
64
Explanation:
the macro call square(4) will substituted by 4*4
so the expression becomes i = 64/4*4 . Since / and * has
equal priority the expression will be evaluated as (64/4)*4
i.e. 16*4 = 64
Is This Answer Correct ? | 231 Yes | 14 No |
Sir... please give some important coding questions asked by product companies..
main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;
What are segment and offset addresses?
Write a program to model an exploding firecracker in the xy plane using a particle system
create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"
void main() { int i=5; printf("%d",i++ + ++i); }
Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?
create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
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 *)); }
write a c program to Create employee record by taking details like name, employee id, address and phone number. While taking the phone number, take either landline or mobile number. Ensure that the phone numbers of the employee are unique. Also display all the details