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 / nilambuja

at starting of loop..
(i=12;6||0;i--)and it print 12 12
(i=11;7||1;i--)and it print 11 11
like wise 10 10 9 9 8 8 7 7
and when (i=6;0||0;i--)
the condition is false hence the crosser will come out of
the loop ..hence output will be... 12 12 11 11 10 10 9 9 8 8
7 7

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is %g in c?

612


What is c basic?

591


What is structure in c language?

613


Who is the founder of c language?

673


What is double pointer?

554






How does struct work in c?

604


swap 2 numbers without using third variable?

656


What is the difference between break and continue?

602


What is ambagious result in C? explain with an example.

2049


Can true be a variable name in c?

555


What is the use of c language in real life?

527


What is the function of this pointer?

666


When can you use a pointer with a function?

562


What is difference between structure and union?

593


Why is C language being considered a middle level language?

652