C Programming :: Increment-Decrement - Discussion
4 / 45
#include<stdio.h>
#include<conio.h>
void main(){
int a,i=4;
a=- -i+- -i+- -5;
printf("%d %d",a,i);
}
#include<stdio.h>
#include<conio.h>
void main(){
int a,i=4;
a=- -i+- -i+- -5;
printf("%d %d",a,i);
}
A13 4
B-3 2
C7 2
D-13 4
ECompilation error
Show Explanation
{
int a,i=4;
int z=5;
\\*a=--i+--i+--5;*// error
a=--i+--i+--z;
printf("%d %d",a,i);}
answer
output ia=8 i=2
Asked In ::
There is an explanation for this answer and that is -
'All the expressions in an initializer for an object that has static storage duration shall be constant expressions or string literals.'
More information can be found here.
https://stackoverflow.com/questions/3025050/error-initializer-element-is-not-constant-when-trying-to-initialize-variable-w
And this limitation is mentioned in these C rules
https://c0x.coding-guidelines.com/index.html
Read Full Answer
Report Error
Please Login First Click Here
void main()
{
int a,i=4;
int z=5;
\\*a=--i+--i+--5;*// error
a=--i+--i+--z;
printf("%d %d",a,i);}
answer
output ia=8 i=2
Read Full Answer
Report Error
Please Login First Click Here
void main()
{
int a,i=4;
int z=5;
\\*a=--i+--i+--5*//error
a=--i+--i+--z;
printf("%d %d",a,i);
}
answer
output= a=8 i=2
Read Full Answer
Report Error
Please Login First Click Here