EmbLogic's Blog

About Scanf

Q1. Can we print any cotent in the scanf statement (like, as “Datais”,) is tried to printed in the following program. If no then why not, if yes then why?
Q2.Why the following program is producing outuput as “DATA is 0″ ?

void main()
{
char data;
scanf(“Data is %c”,&data);
printf(“Datais %d”,data);
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>