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 is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What is clrscr in c?
What is uint8 in c?
What are the types of pointers?
Discuss the function of conditional operator, size of operator and comma operator with examples.
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
Why do we need a structure?
What is far pointer in c?
How many levels of indirection in pointers can you have in a single declaration?
What does struct node * mean?
Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?
What is the purpose of main( ) in c language?
What are the types of arrays in c?
What is the ANSI C Standard?
What do you understand by friend-functions? How are they used?