C
Programming and Technical
Programming
Output
whta is the ouput if we execute this code
#include
extern int x;
int main()
{
do{
do{
printf("%o",x);
}
while(!-2);
}
while(0);
}
return 0;
}int x=8;
Read Solution (Total 5)
-
- for that question they gave option like a)8 b)9 c)10 d)11
answer is "10" y bcz means when we convert 8 into octal bcz there %o used which is octal symbol
and here no incremnets decryments wil be used directly after converting 8 into octal and answer will be printed
ie..,10 is the answer (ans-c) - 8 years agoHelpfull: Yes(1) No(0)
- here is no '}' before return if we removed that one then output will be 10 .
converting 8 into octal number bcz here %o is used which is octal symbol
like |_8__ 0 so in octal no 8 is refferd as 10 so answer is 10 will be printed
1 - 8 years agoHelpfull: Yes(1) No(0)
- error, because of extra curly bracket.
- 8 years agoHelpfull: Yes(0) No(0)
- error!!expected '(' before return.
- 8 years agoHelpfull: Yes(0) No(0)
- 8 will be the ans
- 8 years agoHelpfull: Yes(0) No(0)
C Other Question
he year is 2050. The population surge has taken over our metropolitan cities. High rise buildings are on a rise. And as usual, with the increase in population, the problem of parking in the city has increased manifold.
To reduce the problem of parking, the government has built multi-storey parking lots all over the city. Imagine the city as an X-Y grid. And there are roads connecting all the neighbouring grid points except diagonals. And there is a pre-defined intersection interval 'I' for parking lots such that at every I th intersection, there is a parking lot, starting from (0,0). For example, for a city of grid size 4x7 and I=3, you'll have 6 parking lots at (0,0), (0,3), (0,6), (3,0), (3,3) and (3,6).
#include
void main()
{
int a=3,b=6,c=8;
printf("%d %d %d");
getch();
}
the output is
8 6 3
HOW?