write a program in c to print all the alphabets using a pointer

Solutions on MaxInterview for write a program in c to print all the alphabets using a pointer by the best coders in the world

showing results for - "write a program in c to print all the alphabets using a pointer"
Fynn
26 May 2018
1#include<stdio.h>
2#include<stdlib.h>
3
4int main()
5{
6	
7	int *c;	// declare a character pointer
8	c = (int *)malloc(sizeof(int));	// assigning memory to c
9	
10	*c = 'A';	// conpiler automatically convet 'A' to corresponding ASCII value, that is 65
11				// the store value is stored in c
12		
13	// checking if integer pointed by c
14	// is less than equal to ASCII value os alphabet 'Z'
15	while(*c<='Z'){
16		
17		printf("%c\n",*c);	// %c prints the character whose ASCII value is equal to *c
18		*c = *c + 1;	// increment the integer value that pointer c is pointing to
19		
20	}
21	
22}