main()
{
char password(15),c;
int i ;
printf("Enter password");
i =0;
do
{
password[i]=getch();
c=password[i];
if(c==13) /*since ascii value of Enter is 13*/
break;
else
printf("*");
i++;
}while(1);
password[i ]=`\०';
printf("\nThe entered password is %s"password);
getch();
}
/*Programme to display Nepali flag*/ # include <stdio.h> #include <stdlib.h> void main() { int i,j; for(i=1;i<=20;i++) { if(i<=8) { for(j=1;j<=8;j++) { if(j==1||i==j&&i<8) printf("* "); else if(i==8&&j>=3) printf("* "); else printf(" "); } } else if(i>8&&i<=12) { for(j=1;j<=7;j++) { if(i==12||j==1||i-j==5) printf("* "); else printf(" "); } } else if(i>12) printf("* "); printf("\n\n\n"); } }
Comments
Post a Comment