Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Find the errors in the program:
C
#include <stdio.h>
#define CUBE(Y) (Y)*(Y)*(Y) ;
#define SQUARE(Y) (Y)*(Y);
int main() 
{ double  Int,y,_y1,2yb,a-b,y3z;
Int Float,char,a,b,c,d,xy@c,qa.b; 
char int,u,_2v,w=t; 
a=2,b=3; 
a+b; 
c=a+b; 
a+b=1; 
b-a==c; 
d=w; 
a=CUBE(d); 
b=SQUARE(d)
u=d+62; 
c=u-1; 
u=’y’; 
_2v=z; 
y3z=CUBE(c);
 y=SQUARE(c);
 _y1=SQUARE(c)*2; 
c=y+u; 
return 0;
}


What I have tried:

I have tried finding out some of the errors.
Posted
Updated 30-Sep-18 21:14pm
v2
Comments
Nelek 30-Sep-18 9:57am    
But did you try it hard?
OriginalGriff 30-Sep-18 10:09am    
No, but he figured we would. We need a "Lazy student" medal ... :laugh:
Nelek 30-Sep-18 10:26am    
maybe an idea for a new cathegory on monthly awards?

What do you want, a list?

Grab your favorite C compiler, and compile it.
It will give you a list, which will be quite lengthy. And it will ignore stylistic errors, stupid - but legal - naming ideas, and the toal lack of usefulness of most of that code.

But ... We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
So as far as fixing them, you are on your own ... Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
 
Share this answer
 
Why would you ever declare a double variable with the name Int, or 2yb or (even worse) a-b?
What do you actually think is meant by the expression Int Float, or char int, or w=t?

I suggest you throw this away and get yourself a good study guide on the C language.
 
Share this answer
 
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing.
 
Share this answer
 
Learn to use the debugger.

tip: write your code clearer, use longer variable names and make some output.
 
Share this answer
 
Comments
Patrice T 1-Oct-18 7:24am    
I fear this code do not even compile.
KarstenK 1-Oct-18 11:17am    
I wont touch such dirty mess. :-O

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900