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 |
Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….
1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?
Are there constructors in c?
Do character constants represent numerical values?
How can you be sure that a program follows the ANSI C standard?
main() { struct test { char c; int i; char m; } t1; printf("%d %d\n", sizeof(t1), sizeof(t1.c)); }
1 Answers Vector, Vector India,
suppose there are five integers write a program to find larger among them without using if- else
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
How to find a missed value, if you want to store 100 values in a 99 sized array?
What's wrong with the call "fopen ("c:\newdir\file.dat", "r")"?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
int main(){ float f=8.0; if(f==8.0) printf("good"); else printf("bad"); } what is the answere and explain it?