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 are the 5 elements of structure?
Is r written in c?
What is a rvalue?
Can i use “int” data type to store the value 32768? Why?
What is p in text message?
What is the sizeof () a pointer?
What are c identifiers?
application attempts to perform an operation?
How to set file pointer to beginning c?
Do you know the purpose of 'register' keyword?
What are categories used for in c?
What is array in C
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
Explain modulus operator.
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.