Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my code:
C
#include stdio.h;
#define LAST 10
int main()
{
int i, sum = 0;
for ( i = 1; i <= LAST; i++ )
{
       sum += i;
}
/*-for-*/
printf("sum = %d\n", sum);
return 0;
}


[Edit]The error message is:
Here OP should post the error message
[/Edit]

Please help me.
Thanks in advance!
Posted
Updated 9-Mar-11 1:19am
v2
Comments
Manfred Rudolf Bihy 9-Mar-11 7:21am    
Please edit you question (Improve question) and post the exact error message in the slot I prepared for you in your question.
Manfred Rudolf Bihy 9-Mar-11 7:22am    
Edit: Removed text speak.
Аslam Iqbal 9-Mar-11 7:47am    
The Error is: Bad file name format in include directive

Try surrounding stdio.h with '<' and '>':
#include stdio.h;
becomes
#include <stdio.h>
That should fix it!
 
Share this answer
 
v2
Comments
Manfred Rudolf Bihy 9-Mar-11 7:57am    
Superflous semicolon removed! 5+
Аslam Iqbal 9-Mar-11 7:59am    
yeah now its okay my 5 too
Sergey Alexandrovich Kryukov 9-Mar-11 16:00pm    
This is well spotted, my 5. However, it could be a result of failure to use CodeProject HTML formatting.
--SA
OriginalGriff 10-Mar-11 4:02am    
Not quite: that also removes anything within the HTML Tab indicators, so the "stdio.h" would have gone as well. :laugh:
Sergey Alexandrovich Kryukov 10-Mar-11 4:08am    
OK then.
--SA
Griff was so close.
C#
#include <stdio.h>// not #include stdio.h; or #include <stdio.h>;
#define LAST 10
int main()
{
int i, sum = 0;
for ( i = 1; i <= LAST; i++ )
{
       sum += i;
}
/*-for-*/
printf("sum = %d\n", sum);
return 0;
}//

It works fine with the output: sum = 55
 
Share this answer
 
v3
Comments
Аslam Iqbal 9-Mar-11 7:56am    
I don't why I can't remove this after the code:<</stdio.h>><</stdio.h>>
Manfred Rudolf Bihy 9-Mar-11 8:01am    
The problem with < and > is that they have to be encoded otherwise it will be interpreted as a HTML tag and a matching closing tag will be generated. Encode < = &lt; and > = &gt;
FTFY :)
Manfred Rudolf Bihy 9-Mar-11 8:01am    
Well spotted, 5+!
Аslam Iqbal 9-Mar-11 8:03am    
Thanks Manfred for everything.
Manfred Rudolf Bihy 9-Mar-11 8:21am    
Your welcome, and please call me Manfred, thats my given name. :)
Code looks fine to me. Where are you getting the error message, and what error message is it?
 
Share this answer
 

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