1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

output of the program

Discussion in 'C' started by karun_happy, Nov 28, 2006.

Thread Status:
Not open for further replies.
  1. karun_happy

    karun_happy New Member

    Joined:
    Nov 17, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Help me out her i m new to C
    i have made one program and i m not getting its output... can anybody tell me how to get it's output..herew is the sorce code

    Code:
    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int i=0;
    char ch[25],c;
    printf("enter ur name n press 0 to exit");
    do{
    c=getch();
    ch[i]=c;
    i++;
    }while(c!='0');
    i=i-1;
    ch[i]='\0';
    }
    in this program i want to ask the user his/her name and enter each character the name one by one and after entering the name end the program as i have done in this program.in this program,i have used 0 to end it...problem i m getting is that everything is fine--its compiling and when i enter any character it doesnot enter anything and when i press 0 to end it,it ends,,,so tell me how i can get its output...or is ther any other way to do this .
    plz suggest
    thanxs
    Regards Karun
     
    Last edited by a moderator: Nov 29, 2006
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
Thread Status:
Not open for further replies.

Share This Page