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  (6 || 0) and i = 11
1 ieteration  (7 || 1) and i = 10
1 ieteration  (0 || 3) and i = 9
1 ieteration  ( 2|| 4) and i = 8
1 ieteration  (4 || 5) and i = 7
1 ieteration  (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
Explain how can I make sure that my program is the only one accessing a file?
What is meant by preprocessor in c?
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
Write a program which returns the first non repetitive character in the string?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
What is the difference between far and near in c?
How are strings stored in c?
What do you mean by keywords in c?
What are the restrictions of a modulus operator?
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.
Explain what is meant by 'bit masking'?
How does free() know explain how much memory to release?
Can a variable be both constant and volatile?
What does double pointer mean in c?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0