answersLogoWhite

0

#include<stdio.h>

int main (void)

{

char upper[27]; // A-Z plus null terminator char lower[27]; // a-z plus null terminator char c;

int i;

for (i = 0, c = 'A'; c <= 'Z'; ++c, ++i)

{

upper[i] = c;

lower[i] = c - 'A' + 'a';

}

upper[i] = 0; // null-terminator

lower[i] = 0; // null-terminator

printf ("%s\n", upper);

printf ("%s\n", lower);

return 0;

}

User Avatar

Wiki User

8y ago

What else can I help you with?

Related Questions

Write an assembly language program to print a to z on screen?

write a program to print A to Z on screen in c?


Write a program to initialize a character and print whether it is uppercase lowercase or special character in java module 1?

I'll just write a function to do that, I hope the good people won't try to run it as it is.... void function() { char c = 'a'; if( c &gt;= 'a' &amp;&amp; c &lt;='z' ) System.out.println("LowerCase"); else if( c&gt;='A' &amp;&amp; c &lt;='Z' ) System.out.println("UpperCase"); else System.out.println("Special Character"); }


Write a program to print whether the letter is vowel or not in BASIC?

vowels$ = "aeiou" CLS PRINT "PROGRAM: Find if letter is a vowel or not" PRINT INPUT "Type a single alphabet letter: (a-z)/and, then, press Enter key"; aLetter$ PRINT PRINT "Letter "; aLetter$; IF INSTR(vowels$, LCASE$(aLetter$)) THEN PRINT " is a vowel." ELSE PRINT " is NOT a vowel." END


What is the Logic to print the letters from A to Z without using printf in Turbo C plus plus?

#include&lt;iostream&gt; int main() { using namespace std; char c='A'; do { cout&lt;&lt;c; }while(c++&lt;'Z'); cout&lt;&lt;endl; }


Write a FORTRAN program using if statement to calculate the smallest of three numbers xyz?

N = x If y &lt; N then N = Y If z &lt; N then N = z Print N


Is there a instrument that start with a Z?

Zither. It has 12 strings and you pluck them.


C program to find both the largest and smallest numbers in the given list without applying array?

I'll assume the list is supplied as arguments to the program: #include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; main (argc, argv) int argc; char **argv; { int c = 0, mn, mx, z; while (--argc) { z = atoi(*(++argv)); if (!c++) mx = mn = z; else if (z &gt; mx) mx = z; else if (z &lt; mn) mn = z; } if (c) printf("%d numbers, min = %d, max = %d\n", c, mn, mx); else printf("No arguments given: please supply a list of numbers as arguments\n"); } Any error trapping is left as an exercise.


How do you factor c cubed minus z cubed?

(c - z)(c^2 + cz + z^2)


Program which inputs two complex numbers and finds the sum and product of those numbers?

Try thisinput "z =?";x,yprint "z=";x;"+";y;"i"input "w =?";u,vprint "w=";u;"+";v;"i"print "z+w = ";x+u;"+";y+v;"i"print "z*w = ";x*u-y*v;"+";x*v+y*u;"i"example output:z=? 1,2w=? 2,3z+w = 3+5iz*w = -4+7iNote that it is possible to input negative imaginary parts. To display the sum and product correctly in that case, you need to make an intermediate step in the program which assigns the imaginary part to a separate variable, decide whether or not the imaginary part is negative, and then print a "+" if it is positive or no sign when it is negative (printing a negative number will automatically print the negative sign).Of course, you need to modify the program to your computer language.


Check whether a character is alphabaticdigital or special character using C program?

To solve this you need to remember that chars in C are represented as ints. Because of this property, you can use int comparison operators: // to test if character c is a letter int is_alpha(const char c) { if( c &gt;= 'a' &amp;&amp; c &lt;= 'z' ) return 1; if( c &gt;= 'A' &amp;&amp; c &lt;= 'Z' ) return 1; return 0; } // to test if character c is a digit int is_digit(const char c) { if( c &gt;= '0' &amp;&amp; c &lt;= '9' ) return 1; return 0; } To test for a "special character" you would probably do best writing a similar function which checks for other ASCII value ranges.


What is a song that starts with Z?

&middot; Zing Went the Strings Of My Heart - Frank Sinatra


What are some words with c and z in it?

word having c and z is "crazy"