String Program2

 #include<stdio.h>

#include<conio.h>


void main()

{

char ch[5];

clrscr();


printf("Enter 1st character: ");

scanf("%c", &ch[0]);


printf("Enter 2nd character: ");

scanf("%c", &ch[1]);


printf("Enter 3rd character: ");

scanf("%c", &ch[2]);


printf("Enter 4th character: ");

scanf("%c", &ch[3]);


printf("Enter 5th character: ");

scanf("%c", &ch[4]);


printf("\n\nYou have entered 1 character %c", ch[0]);

printf("\n\nYou have entered 2 character %c", ch[1]);

printf("\n\nYou have entered 3 character %c", ch[2]);

printf("\n\nYou have entered 4 character %c", ch[3]);

printf("\n\nYou have entered 5 character %c", ch[4]);


getch();

}

No comments:

Post a Comment