C Program to print all the English Alphabets in lower case

Description

Output:
a b c d e f g h I j k l m n o p q r s t u v w x y z

Solution

#include<stdio.h>
int main()
{
	int i;
	for(i='a';i<='z';i++)
	{
		printf("%c",i);
	}
	return 0;
}

Explanation

Instruction(s) inside the for block{} are executed repeatedly till  the second expression is true.

Here i is initialized to a (97) and incremented by 1 for each iteration, instructions inside the for block are executed unless i becomes greater than z(122). so value of i will be printed as character like a,b,c...z using printf statement and format specifier %c.



Interesting Pattern Programs: for more Patterns

Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution
Input:
5
Output:
    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *Solution
Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution
Input:
5
Output:
*********
 *******
  *****
   ***
    *
   ***
  *****
 *******
*********Solution