Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
#include<stdio.h>
#include<conio.h>

void main()  
{
    int i = 0;
    char ch;
    clrscr();

    for (i = 0; i < 256; i++)
    {
        printf("%c ",ch)<-- function call missing (
        ch = ch + 1;
    }<-- Statement missing ;

    getch();
}


What I have tried:

Well,at school i do not have IT class yet,so i really don't know what to do so i thought you could help,thanks
Posted
Updated 4-Feb-17 6:00am
v2
Comments
[no name] 4-Feb-17 11:23am    
printf("%c ",ch);
PIEBALDconsult 4-Feb-17 11:25am    
I see only
Statement missing ; in function main
because you left the semi-colon off one of your statements -- you should be able to figure it out.
PIEBALDconsult 4-Feb-17 11:35am    
Which compiler are you using?
Michael_Davies 4-Feb-17 13:13pm    
Also ch is not initialised.

1 solution

According to the comments of NotPolitcallyCorrect - Professional Profile[^] and PIEBALDconsult - Professional Profile[^] the following should be the solution:


#include<stdio.h>
#include<conio.h>

void main()  
{
    int i = 0;
    char ch;
    clrscr();

    for (i = 0; i < 256; i++)
    {
        printf("%c ",ch); // The missing semicolon
        ch = ch + 1;
    }

    getch();
}


Keep in mind I was _not_ the one giving the solution, the two members mentioned above are the ones, I only wrote it down finally ;)
 
Share this answer
 
Comments
PIEBALDconsult 4-Feb-17 14:30pm    
No "solution" should be provided for such a noobish question.
[no name] 4-Feb-17 14:35pm    
Thank you for the downvote. At least this way the Q disapears from unanswered Q.
[no name] 4-Feb-17 14:35pm    
Thank you for the downvote. At least this way the Q disapears from unanswered Q.

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