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

Display this kind of output on screen. 1 0 1 1 0 1 3. Display this kind of output on screen. 1 1 0 1 0 1 4. Display this kind of output on screen. 1 1 0 1 0 1 5.Display this kind of output on screen. 1 2 3 4 5 6 7 8 9 10

1 Answers  


write a profram for selection sort whats the error in it?

2 Answers  


Why are memory errors hard to debug?

1 Answers  


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

4 Answers  


How to convert hexadecimal to binary using c language..

1 Answers   Bajaj, GAIL, Satyam, Zenqa,






who was the present cheif governor of reserve bank of india

6 Answers   State Bank Of India SBI,


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

0 Answers  


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

3 Answers  


What is the out put of this programme? int a,b,c,d; printf("Enter Number!\n"); scanf("%d",&a); while(a=!0) { printf("Enter numbers/n"); scanf("%d%d%d",&b,&c,&d); a=a*b*c*d; } printf("thanks!"); getche(); Entering numbers are a=1,b=2,c=3,d=4 b=3,c=4,d=-5 b=3,c=4,d=0

5 Answers   TCS,


which typw of errors ? & how to solve it ?

0 Answers  


#include<stdio.h> void main() { int i=1; printf("%d%d%d",i++,++i,i); }

19 Answers  


Given that two int variables, total and amount, have been declared, write a loop that reads integers into amount and adds all the non-negative values into total. The loop terminates when a value less than 0 is read into amount. Don't forget to initialize total to 0. Instructor's notes: This problem requires either a while or a do-while loop.

3 Answers  


Categories