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 |
Predict the output or error(s) for the following: 25. main() { printf("%p",main); }
What is difference between constant pointer and constant variable?
How to develop software using "c" programming?
how is the examination pattern?
main() { static char *s[]={"black","white","yellow","voilet"}; char **ptr[]={s+3,s+2,s+1,s}, ***p; p=ptr; **++p; printf("%s",*--*++p+3); }
What are the 5 types of inheritance in c ++?
Why pointers are used in c?
write a c program to check weather a particluar bit is set or not?
Explain the difference between call by value and call by reference in c language?
1. Write a program to reverse every second word in a given sentence.
What is volatile keyword in c?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.