Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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);
}

Answers were Sorted based on User's Feedback



Sir,please help me out with the output of this programme:- #include<stdio.h> #include<c..

Answer / biren

the answer is 6

Is This Answer Correct ?    5 Yes 2 No

Sir,please help me out with the output of this programme:- #include<stdio.h> #include<c..

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

Sir,please help me out with the output of this programme:- #include<stdio.h> #include<c..

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

Sir,please help me out with the output of this programme:- #include<stdio.h> #include<c..

Answer / jaguar

Check how loop runs


At start of the loop for (I = 12; (18 % 12 || 12 % 12); i--)


1 ieteration &#61664; (6 || 0) and i = 11
1 ieteration &#61664; (7 || 1) and i = 10
1 ieteration &#61664; (0 || 3) and i = 9
1 ieteration &#61664; ( 2|| 4) and i = 8
1 ieteration &#61664; (4 || 5) and i = 7
1 ieteration &#61664; (0 || 0) and i = 6 Loop comes out then the
value of I prited is 6

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More C Interview Questions

Is return a keyword in c?

0 Answers  


what does ‘segmentation violation’ mean?

1 Answers  


#include<stdio.h> main() { int a=1; int b=0; b=++a + ++a; printf("%d %d",a,b); }

7 Answers   Infosys,


Explain how can I pad a string to a known length?

0 Answers  


You are given a string which contains some special characters. You also have set of special characters. You are given other string (call it as pattern string). Your job is to write a program to replace each special characters in given string by pattern string. You are not allowed to create new resulting string. You need to allocate some new memory to given existing string but constraint is you can only allocate memory one time. Allocate memory exactly what you need not more not less.

2 Answers   Microsoft,


If null and 0 are equivalent as null pointer constants, which should I use?

0 Answers  


Write a program for the following series: 1*3*5-2*4*6+3*5*7-4*6*8+.................up to nterms

5 Answers   Convex Digital,


What is the difference between array and structure in c?

0 Answers  


write a program to generate 1st n fibonacci prime number

12 Answers  


WHAT IS FLOAT?

3 Answers  


plz let me know how to become a telecom protocol tester. thank you.

0 Answers  


can a union be self-referenced?

1 Answers  


Categories