Phani
2012-05-12 01:25:50 UTC
if i type the code i will get the book name.
for ex:
#include
main()
{
int c;
printf("code: ");
scanf("%d",&c);
if(c==123) // if code is 123 book name is XYZ
printf("book name is: XYZ");
getch();
}
output is
code: 123
book name is: XYZ
This is done successfully
Now i want to enter the "book name" and get the "code" as output.
For ex:
#include
main()
char bname; // where bname is Book name
printf("enter book name: ");
gets(bname);
if(bname==XYZ) // the error goes here: XYZ undeclared
printf("code: 123);
getch();
}
This is not happening.
Here the compiler says "XYZ is undeclared"
so what should i do to get the required output.
please help me guys...
please suggest me a program for such situations
please guys...