View Single Post
Old 10-31-2006, 07:43 AM   #15 (permalink)
neeven
Recruit
 
Join Date: Oct 2006
Posts: 7
neeven is on a distinguished road
how do i make the following program run forever...
Code:
#include <stdio.h>
main()
{
char line[100];

int count;

printf("Enter a line of text below:\n\n");

scanf("%[^\n]", line);

printf("\n\n");

printf("\nEncoded text:\n\n");

for(count=0; line[count]!='\0'; ++count)
{

if(((line[count]>='A') && (line[count]<'Z')) || ((line[count]>='a') && (line[count]<'z')))

putchar(line[count]+1);

else if (line[count]=='z') 

putchar('a');

else if (line[count]=='Z') 

putchar('A');

else putchar(line[count]);

}
printf("\n\n");
  getch();
return 0;
	
}

Last edited by redhead; 10-31-2006 at 09:52 AM.
neeven is offline   Reply With Quote