There are lot of other problems. See the modified code
Code:
#include<stdio.h>

int main()
{
 int i=0;
 char ch[25],c;
 printf("enter ur name n press 0 to exit");
  do{
   c=getchar();
  ch[i]=c;
  i++;
 }while(c!='0');
 i=i-1;
 ch[i]='\0';
 return 0;
}