Sir,please help me out with the output of this programme:-
#include<stdio.h>
#include<conio.h>
void main()
{
int a=18,b=12,i;
for(i=a<b?a:b;a%i||b%i;i--);
printf("%d %d",i);
}
Answer Posted / jaguar
Check how loop runs
At start of the loop for (I = 12; (18 % 12 || 12 % 12); i--)
1 ieteration  (6 || 0) and i = 11
1 ieteration  (7 || 1) and i = 10
1 ieteration  (0 || 3) and i = 9
1 ieteration  ( 2|| 4) and i = 8
1 ieteration  (4 || 5) and i = 7
1 ieteration  (0 || 0) and i = 6 Loop comes out then the
value of I prited is 6
Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
What are global variables and explain how do you declare them?
What is an identifier?
Here is a neat trick for checking whether two strings are equal
Who developed c language and when?
What is variables in c?
Dont ansi function prototypes render lint obsolete?
What is ## preprocessor operator in c?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What are types of preprocessor in c?
What is strcpy() function?
What does static variable mean in c?
Why c is procedure oriented?
Lists the benefits of c programming language?