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 / manish soni bca 3rd year jaipu
hi frds,manis soni tagore collage jaipur
in this prm,
initily
for(i=12;a%i||b%i;i--);
--------|-------|--------|
a%i | b%i | i--;|
--------|-------|--------|
18%12=6*|** |12--=11;|
--------|-------|--------|
18%11=7*|** |11--=10;|
--------|-------|--------|
18%10=8*|** |10--=9; |
--------|-------|--------|
18%9=0 *|12%9=3 |9--=8; |
--------|-------|--------|
18%8=2 *|** |8--=7; |
--------|-------|--------|
18%7=4* |** |7--=6; |
--------|-------|--------|
18%6=0 *|12%6=0 |***; |
--------|-------|--------|
summory of the program
here we dissuss sum property
-----------------------------------
coition1||(or operaor)conditon 2;
-----------------------------------
in this case if condition1 is ture then
the second condition will not excute;
this is property of OR opr.
------------------------------------
here->(*)is represent condition1 and
------------------------------------
2.if c1 is false then c2 is true
this is represent **.
--------------------------------------
if c1 and c2 both are false then
***.
this is termination point.
and print 6;
bcoz at 6 both the condition are false.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is substring in c?
Explain goto?
what will be maximum number of comparisons when number of elements are given?
What is a class c rental property?
Explain how can you check to see whether a symbol is defined?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
How was c created?
Tell us bitwise shift operators?
What are comments and how do you insert it in a C program?
Why is %d used in c?
why return type of main is not necessary in linux
What are types of preprocessor in c?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What is NULL pointer?
What is a ternary operator in c?