i=20,k=0;
for(j=1;j<i;j=1+4*(i/j))
{
k+=j<10?4:3;
}
printf("%d", k);
Answers were Sorted based on User's Feedback
Answer / abi
all the above answers are wrong!
just think the below logic...
in for loop j=1+4*20 so j=81
81<10 is false...so 3 is assigned
k+=3 ie k=k+3
k=0+3
k=3
so answer is 3
Is This Answer Correct ? | 15 Yes | 15 No |
Answer / suchita
k=5 bcoz the statement k+=j<10?4:3;
here k+ increaments the value then assign to the k
Is This Answer Correct ? | 1 Yes | 11 No |
how to implement stack operation using singly linked list
which of the function operator cannot be over loaded a) <= b)?: c)== d)*
10 Answers Cisco, CTS, Google, HCL, HP,
Why is it that not all header files are declared in every C program?
what will be the output of this program? #include<stdio.h> #define cube(x) x*x*x void main() { int i,j=5; i=cube(j+3); printf("i=%d",i); }
What is the best style for code layout in c?
What tq means in chat?
1 1 2 1 2 3 1 2 3 4 1 2 3 1 2 1 generate this output using for loop
we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?
What does p mean in physics?
#include <stdio.h> #define sqr(x) (x*x) int main() { int x=2; printf("value of x=%d",sqr(x+1)); } What is the value of x?
16 Answers Accel Frontline, Opera, Oracle,
Is c dynamically typed?
How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?