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
What is a function in c?
Why static is used in c?
What is new line escape sequence?
In a switch statement, explain what will happen if a break statement is omitted?
How do you search data in a data file using random access method?
What is #pragma statements?
What is the difference between char array and char pointer?
What is this infamous null pointer, anyway?
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
Explain what is a static function?
What is the best organizational structure?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
What are static variables in c?
What are reserved words with a programming language?
explain what is an endless loop?