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



i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k); ..

Answer / guest

k=4

Is This Answer Correct ?    20 Yes 3 No

i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k); ..

Answer / valli

k=4

Is This Answer Correct ?    9 Yes 4 No

i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k); ..

Answer / vishal bhardwaj

ans is : 4

Is This Answer Correct ?    2 Yes 0 No

i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k); ..

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

i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k); ..

Answer / arun

4

Is This Answer Correct ?    2 Yes 3 No

i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k); ..

Answer / guest

compilation error i is not declared as int

Is This Answer Correct ?    5 Yes 7 No

i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k); ..

Answer / vignesh1988i

k=4;;;;;

Is This Answer Correct ?    1 Yes 6 No

i=20,k=0; for(j=1;j<i;j=1+4*(i/j)) { k+=j<10?4:3; } printf("%d", k); ..

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

Post New Answer

More C Interview Questions

main() { clrscr(); } clrscr();

6 Answers   ME, Wipro,


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

0 Answers  


main() { char ch='356'; Printf("%d",ch); } *OUTPUT*:- -18 *Why?*

1 Answers  


Why is it important to memset a variable, immediately after allocating memory to it ?

0 Answers  


Tell me when is a void pointer used?

0 Answers  






What is infinite loop?

0 Answers  


Is it better to bitshift a value than to multiply by 2?

0 Answers  


find a number whether it is even or odd without using any control structures and relational operators?

22 Answers   Microsoft, Shashank Private Limited,


Can you please explain the scope of static variables?

0 Answers  


what is the benefit of c30

2 Answers  


Symmetric technologies interview questions. For Computer science candidates the first round is a objective type written test consisting of 16 questions.It is very easy ,any police man can solve this. And next round is a written test consists of both objective and subjective .Total 40 question related to c,c++ and operating system related questions. And then a technical interview and give some program to solve with computer.The md is adamant person, whatever he says we have to accept that is the condition. And one more thing ,,,these interview is just for a formality..the company will select only innocent guys.. the person's without a backbone only they require.. And u have to submit the certificates this is the most important problem...So if you are not getting any other jobs..then only join with this... It is better to try for other company...And apart from that symmetric do a lot of projects..If a candidate can manage everything u can join and make good career with this company... The Md will normally speak rudely..but he is good person and he will give you a lot of very good chances to improve your career....but with cheap salary....

0 Answers   Symmetric Technologies,


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

0 Answers   MNC,


Categories