Change ‘upper’ to ‘lower’ case & ‘lower’ to ‘upper’ case in C language..

Some important symbols used in code.

  • () small bracket
  • && use for ‘and’ use for address
  • {} curly bracket
  • “” double code

Print capital letter..

  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. char ch;
  6. int a, b, c;
  7. clrscr();
  8. printf(“print upper case ‘A to Z‘ \n”);
  9. for(a=65;a<=90;a++)
  10. {
  11. printf(“%c”, a);
  12. }
  13. getch();
  14. }

Results..

print small letter….

  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. char ch;
  6. int a, b, c;
  7. clrscr();
  8. printf(“print ‘lower’ case ‘A to Z‘ \n”);
  9. for(a=97;a<=122;a++)
  10. {
  11. printf(“%c”, a);
  12. }
  13. getch();
  14. }

Results..

Print ‘capital’ & ‘small’ letter using ‘for’ loop..

  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. char ch;
  6. int a, b, c;
  7. clrscr();
  8. printf(“print upper case ‘A to Z‘ \n”);
  9. for(a=65;a<=90;a++)
  10. {
  11. printf(“%c”, a);
  12. }
  13. printf(“/n print lower case ‘a to z’ \n”);
  14. for(b=97;b<=122;b++)
  15. {
  16. printf(” %c”, b);
  17. }
  18. getch();
  19. }

Results..

Print ‘capital’ & ‘small’ letter using ‘while’ loop..

  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. char ch;
  6. int a, b, c;
  7. clrscr();
  8. printf(“print upper case ‘A to Z‘ \n”);
  9. a=65;
  10. while(a<=90)
  11. {
  12. printf(“%c”, a);
  13. a++;
  14. }
  15. printf(“/n print lower case ‘a to z’ \n”);
  16. b=97;
  17. while(b<=122)
  18. {
  19. printf(” %c”, b);
  20. b++;
  21. }
  22. getch();
  23. }

Print ‘capital’ & ‘small’ letter using ‘do while’ loop..

  1. #include<stdio.h>
  2. #include<conio.h>
  3. void main()
  4. {
  5. char ch;
  6. int a, b, c;
  7. clrscr();
  8. printf(“print upper case ‘A to Z‘ \n”);
  9. a=65;
  10. do
  11. {
  12. printf(“%c”, a);
  13. a++;
  14. }
  15. while(a<=90);
  16. printf(“/n print lower case ‘a to z’ \n”);
  17. b=97;
  18. do
  19. {
  20. printf(” %c”, b);
  21. b++;
  22. }
  23. while(b<=122);
  24. getch();
  25. }

Results..

Given above…

Design a site like this with WordPress.com
Get started