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
Is null equal to 0 in sql?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
Write a program to use switch statement.
Give basis knowledge of web designing ...
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
Is c language still used?
What are file streams?
Do you have any idea about the use of "auto" keyword?
Write a program to identify if a given binary tree is balanced or not.
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
How can I find out how much free space is available on disk?
When should a type cast be used?
What is array of structure in c programming?
What is the use of a conditional inclusion statement in C?
How to throw some light on the b tree?