Program to print a to z in c using ascii value

Problem statement:- Program to print a to z in c using ASCII value.

Data requirement:-

   Input Data:- i

  Output Data:-i

Program in C

Here is the source code of the C Program to print all alphabets from a to z using a loop.

Code:

#include<stdio.h>
int main()
{
    int i=0;
    printf("Printing a-z using ASCII\n");
    for(i=97;i<=122;i++)
        printf("%c ",i);
}

Input/Output:
Printing a-z using ASCII
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

Program in C++

Here is the source code of the C++ Program to Program to print a to z in c using ASCII value.

Code:

#include<iostream>
using namespace std;
int main()
{
    cout<<"Printing a-z using ASCII\n";
    for(int i=97;i<=122;i++)
        cout<<char(i)<<" ";
}

Input/Output:
Printing a-z using ASCII
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

Program in Java

Here is the source code of the Java Program to print all alphabets from a to z using a loop.

Code:

public class printatozsmall {

public static void main(String[] args) {
System.out.println("Printing a-z using ASCII\n");
    for(int i=97;i<=122;i++)
        System.out.print((char)i+" ");
}
}

Input/Output:
Printing a-z using ASCII
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

Program in Python

Here is the source code of the Python Program to Program to print a to z in c using ASCII value.

Code:

print("Printing a-z using ASCII")
for i in range(97,123):
    print(chr(i),end=" ")

Input/Output:
Printing a-z using ASCII
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 

Post a Comment

0 Comments