Message from C, C++ discussions

January 2020

— I am using Do while loop but i gave it in the correct syntax but.....it didn't get out of the loop

— 

#include<stdio.h>
int main()
{
char a,b;
do
{
printf("Enter the password : ");
scanf("%d",a);
if(a == "letmein")
{
printf("Access Granded");
}
else{
printf("Access denaid \n");
printf("Do you want to continue..(Y/N)");
scanf("%d",b);
}
}while(b == "Y"||"y");
return 0;
}

— This is the code

— What is letmein

— %d is not char

— Just my password......😂

— %c

— Its true

— You need to use an array of chars, not a single char to use scanf
like here at the bottom
https://www.tutorialspoint.com/c_standard_library/c_function_scanf.htm

Message permanent page

— To read a string

— Yes.....thanks...guys...i got it....

— But we can do that also but this will print ASCII value of that character