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
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 |
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 |
void main() { int i=5,y=3,z=2,ans; clrscr(); printf("%d",++i + --z + i++ + --i * ++y); i=5,y=3,z=2; ans=++i + --z + i++ + --i * ++y; printf("\n%d",ans); getch(); } Its output is 37 and 31.... Please explain me why its different How it works.....
I can not get my C++ program to work right. It is supposed to tell if a word is a palindrome or not, but it only tells thet the word is not a palindrome. And I can't fix it.
what is syntax error?
Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;
A sample program using data structure? what is file handling?
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
To generate the series 1+3+5+7+... using C program
UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....
What is the code for following o/p * * * * * * * * * * * * * * * *
full c programming error question based problem
Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have already been declared, use a do...while loop to compute the sum of the cubes of the first n whole numbers, and store this value in total . Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total . Use no variables other than n , k , and total .
How to upgrade LOOP environment, I just mean, how can i make loop statement editable ? I just try some program using loop statement and checking it in multiple compilers. Every compiler showing different output, what's the wrong ? is it a compiler based problem, or loop based problem, tell me why ? and what will be the debugging process, for this kind of problem ?