what is the error in the following code:
main()
{
int i=400,j;
j=(i*i)/i;
}

Answers were Sorted based on User's Feedback



what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }..

Answer / billuyadav208

No Error In This Program.

Is This Answer Correct ?    29 Yes 4 No

what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }..

Answer / hari

400*400=160000
exceeds integer limit

Is This Answer Correct ?    9 Yes 1 No

what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }..

Answer / erohitverma

it is not having return statement

main()
{
int i=400,j;
j=(i*i)/i;
return 0;
}

Is This Answer Correct ?    5 Yes 2 No

what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }..

Answer / srinivas

main fun dont have void so it should return int vale and j=
(i*i)/i here frist it will multiply so 400*400 it is out of
int range so it will take garbage value but it wont show
error for this reason but it will give one garbage value .
bcz we didnt write the return stmt so it will show error....

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More C C++ Errors Interview Questions

UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....

5 Answers  


main() { char c; for(c='A';c<='Z';c++) getch(); }

9 Answers  


wap for bubble sort

3 Answers  


what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }

4 Answers  


what is the large sustained error signal that eventually cause the controller output to drive to its limit

1 Answers   TCS,






Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;

3 Answers  


loop1: { x=i<n?(i++):0; printf("%d",i); exit(x); continue; } Error- misplaced continue. Doubt-1.will the exit(x) be executed for all values of x 2.will this statement go out of the program.

5 Answers   CMC,


class test { int a; public: test(int b):a(b){} void show(){ cout<<a; } }; void main() { test t1; test t2(5); t1.show(); t2.show(); } }

1 Answers  


To generate the series 1+3+5+7+... using C program

18 Answers  


void main() { int i=7; printf("N= %*d",i,i); }

6 Answers   HCL,


void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?

24 Answers   HCL,


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 .

2 Answers  


Categories