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
Are global variables static in c?
How many levels deep can include files be nested?
What is the use of structure padding in c?
Is c is a procedural language?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
Is malloc memset faster than calloc?
Is that possible to store 32768 in an int data type variable?
Why pointers are used?
Explain what math functions are available for integers? For floating point?
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
What is the mean of function?
What is bss in c?
What is a null pointer in c?
Define Spanning-Tree Protocol (STP)
Is stack a keyword in c?