WHAT WILL BE THE OUTPUT OF THE FOLLOWING QUESTION
void main()
{
int x=4,y=3,z;
z=x-- -y;
printf("%d%d%d",x,y,z);
}
Answers were Sorted based on User's Feedback
Answer / arunkumar
it will be 3,3,1
no doubt it is the correcct one..
if anybody have a doubt compile and execute it with turbo c.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / jasmeet singh
hey i typed the output of x=4 but its 3. coz after the
decrement now its value is 3.
Is This Answer Correct ? | 4 Yes | 5 No |
Answer / ramya b.m
The output will be 3 3 1. initially the value of x is 4 and
subtracting it with value of y which is 3 the difference is
1. while printing the value of x is decremented by 1 and
hence the output 3 3 1.
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / tommy tom
331
x = 4-- = 3
y = 3
z = 1
then, when printing, there are no spaces in the "%d%d%d" format string, thus there are no spaces in the printing of the numbers. Also, at the end of the run, the command prompt will be tacked onto the end of the output, as the format string contains no newlines, line returns, or other reasons to assume a nice printing.
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / guru1985
#include<stdio.h>
#include<conio.h>
void main()
{
int x=4,y=3,z;
z=x-- -y;
printf("x=%d\ny=%d\nz=%d",x,y,z);
}
Output=>
x=3
y=3
z=1
Is This Answer Correct ? | 0 Yes | 3 No |
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
To generate the series 1+3+5+7+... using C program
Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has already been declared, use a do...while loop to print a single line consisting of n asterisks. Thus if n contains 5, five asterisks will be printed. Use no variables other than n and j .
Assume that the int variables i and j have been declared, and that n has been declared and initialized. Write code that causes a "triangle" of asterisks of size n to be output to the screen. Specifically, n lines should be printed out, the first consisting of a single asterisk, the second consisting of two asterisks, the third consistings of three, etc. The last line should consist of n asterisks. Thus, for example, if n has value 3, the output of your code should be * ** *** You should not output any space characters. Hint: Use a for loop nested inside another for loop.
what is meant by linking error? how can i solve it? if there is a linking error " unable to open file 'cos.obj'? then what should i do?
#include"stdio.h" #include"conio.h" void main() { int a; printf("\n enter a number:"); scanf("%c\n"); getch(); }
wap for bubble sort
How to develop a program using C language to convert 8-bit binary values to decimals. TQ
quoroum of computer languages?
what are the techniques for reducing the fragility of a memory bug?
How to create a program that lists countries capitals when country is entered? (Terribly sorry, I'm a complete novist to coding with C, am looking for inspiration and general tips on how to code and create this program.)
I'm having trouble with coming up with the correct code. Thank You!! The assignment was to write a program using string functions that accepts a price of an item and displays its coded value. The base of the keys: X C O M P U T E R S 0 1 2 3 4 5 6 7 8 9 Sample I/O Dialogue: Enter Price: 489.50 Coded Value: PRS.UX