Close Back

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

main()
{
	char ch = ' '/*,response[4]*/;
	char sentence[50];
	int i=0,j=0,n = 0;   /*i = index for 'for' loop*/

	clrscr();

  /*   do
      {
	char sentence[50];*/
	printf("\nPlease enter a sentence:");

	for(i=0;((ch = getchar())!= '\n')&& j<49;i++)   /*input only text (!digits) && (!anything else)*/
	{
		if(isalpha(ch)||isspace(ch))
		{
			sentence[j] = ch;
			sentence[j+1] = '\0';
			j++;
		}
		n = i+1;
	}

	printf("\n\1The original sentence is:\n\t%s",sentence);
	printf("\n");

	for(i=0;i<n;i++)
	{
		if(isupper(sentence[i]))
			sentence[i] = tolower(sentence[i]);
		else if(islower(sentence[i]))
			sentence[i] = toupper(sentence[i]);
	}

	printf("\n\2The modified sentence is:\n\t%s",sentence);

/*	printf("\n\nDo once more? (y/n):");
	scanf("%3s",response);
	for(i=0;i<49;i++)
		sentence[i] = '';
		n=0;

      }
      while(response[0] == 'y' || response[0] == 'Y');*/
      printf("\n\n\n\t\tHit any key to continue...");
      getch();
      print_rajesh();
}

/*************************************************************************************/
/* A C Function to print rajesh in a stylish way can (should) be used in any cprogram*/
/*************************************************************************************/

print_rajesh()
{
	clrscr();
	printf("\nThis program made by :");
	printf("\n\n\n\n\n\007");
	printf(",##########.                   ,####.                          ,####.\n");
	printf(":#############.                `####;                          :####.\n");
	printf(":#####. :#####.                                                :####.\n");
	printf(":#############;   `#########.  ,####.  ,#######.    ,########. :###########.\n");
	printf(":############;          :####. :####. ,###. :###.  ,####.  :#. :###########.\n");
	printf(":##########.       :#########. :####.,####. :####.`##########. :####. :####.\n");
	printf(":###########.   ,############. :####.:###########;  `#########.:####. :####.\n");
	printf(":############.  :#####. :####. :####.`#####.            :#####;:####. :####.\n");
	printf(":#####. `######  ############. :####. `#########.  ,#########; :####. :####.\n");
	printf("`#####;  `######; `##########; :####.     `#####;  `#######;   `####; `####;\n");
	printf("                              #####");
	printf("\n\n\n\tRajesh _ThE gReAt in 2k.....\n\n\n\t\t\tHit any key to continue.....");
	getch();
}