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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

2270


What is clrscr in c?

1140


What is uint8 in c?

1114


What are the types of pointers?

1122


Discuss the function of conditional operator, size of operator and comma operator with examples.

1167


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

1079


Why do we need a structure?

1054


What is far pointer in c?

1321


How many levels of indirection in pointers can you have in a single declaration?

1095


What does struct node * mean?

1028


Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

2138


What is the purpose of main( ) in c language?

1143


What are the types of arrays in c?

1184


What is the ANSI C Standard?

1286


What do you understand by friend-functions? How are they used?

1214