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

Explain how can I make sure that my program is the only one accessing a file?

1211


What is meant by preprocessor in c?

992


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

1073


Write a program which returns the first non repetitive character in the string?

1102


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

3228


What is the difference between far and near in c?

1048


How are strings stored in c?

1002


What do you mean by keywords in c?

1123


What are the restrictions of a modulus operator?

1104


Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.

2287


Explain what is meant by 'bit masking'?

1179


How does free() know explain how much memory to release?

1040


Can a variable be both constant and volatile?

1094


What does double pointer mean in c?

1144


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1933