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 are the 5 elements of structure?

1043


Is r written in c?

1114


What is a rvalue?

1142


Can i use “int” data type to store the value 32768? Why?

1146


What is p in text message?

937


What is the sizeof () a pointer?

927


What are c identifiers?

1042


application attempts to perform an operation?

1918


How to set file pointer to beginning c?

1151


Do you know the purpose of 'register' keyword?

975


What are categories used for in c?

1037


What is array in C

1101


int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above

1223


Explain modulus operator.

1002


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1219