#include<stdio.h>
#include<conio.h>
void main()
{
char arr[10];
int i;
clrscr();
for(i=0;i<10;i++)
{
printf("enter a char");
fflush(stdin);//plz try with out fflush u will see system accept enter key as char,
// and only 5 char rch as result//
scanf("%c",&arr[i]); //try this arr[i]=getch() ; instead of scanf o
}
printf("\n given char");
for(i=0;i<10;i++)
{
printf("\n %c",arr[i]);
}
getch();
}
#include<conio.h>
void main()
{
char arr[10];
int i;
clrscr();
for(i=0;i<10;i++)
{
printf("enter a char");
fflush(stdin);//plz try with out fflush u will see system accept enter key as char,
// and only 5 char rch as result//
scanf("%c",&arr[i]); //try this arr[i]=getch() ; instead of scanf o
}
printf("\n given char");
for(i=0;i<10;i++)
{
printf("\n %c",arr[i]);
}
getch();
}
No comments:
Post a Comment