Conversion from uppercase to lower case using c program



Conversion from uppercase to lower case using c program

#include<stdio.h>
#include<string.h>
int main(){
  char str[20];
  int i;
  printf("Enter any string->");
  scanf("%s",str);
  printf("The string is->%s",str);
  for(i=0;i<=strlen(str);i++){
      if(str[i]>=65&&str[i]<=90)
       str[i]=str[i]+32;
  }
  printf("\nThe string in lower case is->%s",str);
  return 0;
}

County String


#include
<stdio.h>
int isvowel(char chk);
int main(){
  char text[1000], chk;
  int count;
  count = 0;
  while((text[count] = getchar()) != '\n')
            count++;
  text[count] = '\0';
  count = 0;
  while ((chk = text[count]) != '\0'){
      if (isvowel(chk)){
           if((chk = text[++count]) && isvowel(chk)){
               putchar(text[count -1]);
              putchar(text[count]);
              putchar('\n');
           }
      }
      else
           ++count;
  }
  return 0;
}
int isvowel(char chk){
  if(chk == 'a' || chk == 'e' || chk == 'i' || chk == 'o' || chk == 'u')
      return 1;
  return 0;
}

 Diamond Design

#include <stdio.h>
 int main()
{
int n, c, k, space = 1;
  printf("Enter number of rows\n");
  scanf("%d", &n);
 space = n - 1;
 for (k = 1; k <= n; k++)
  {
for (c = 1; c <= space; c++)
      printf(" ");
 space--;
 for (c = 1; c <= 2*k-1; c++)
      printf("*");
 printf("\n");
  }
 space = 1;
 for (k = 1; k <= n - 1; k++)
  {
for (c = 1; c <= space; c++)
      printf(" ");

    space++;
 for (c = 1 ; c <= 2*(n-k)-1; c++)
      printf("*");
 printf("\n");
  }
 return 0;
}

 
Share on Google Plus

About Unknown

Hello, My name is Mou, I am from Dhaka, Bangladesh and who is trying keep her hand at blogging. I enjoy writing, anything from how to- pieces to endure to just anything at all. My blog will go into detail about all of article. Long time I work with adsense and blogging about 10 years. Doing some SEO work and like that. Please stay close for track down your article for your task and assignment. Feel free to contact with me at moujuena.mou@gmail.com if need. Thanks for visiting.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment