New Member FAQ | Forums | Earn Revenue | Distance Education | Help Topics | Admissions 2013
Awards & Gifts
 
Login Login    Register      

ArticlesPractice TestsAsk ExpertsQuestion PapersJobsUniversitiesCollegesCoursesSchools

Active Members
TodayLast 7 Daysmore...

Join our online Google+ community for Bloggers, Content Writers and Webmasters




Forums » Education » General »

Solve it easy c question


Posted Date: 05 Jun 2009      Posted By:: Malathi     Member Level: Silver    Member Rank: 3954     Points: 1   Responses: 4



#define clrscr() 100
main()
{
clrscr();
printf("%d\n",clrscr());
}




Responses

#88910    Author: Deepakkumar Devarajan      Member Level: Gold      Member Rank: 0     Date: 05/Jun/2009   Rating: 2 out of 52 out of 5     Points: 1

I guess zero or one might the output , I am not good in C or C++, please let me know the answer

Regards,
Deepakkumar D
Join My community :



 
#89418    Author: Malathi      Member Level: Silver      Member Rank: 3954     Date: 07/Jun/2009   Rating: 2 out of 52 out of 5     Points: 3

Explanation:
Preprocessor executes as a seperate pass before the execution of the compiler. So textual replacement of clrscr() to 100 occurs.The input program to compiler looks like this :
main()
{
100;
printf("%d\n",100);
}
Note:
Line 1: 100; is an executable statement but with no action. So it doesn't give any problem
Answer: 100



 
#89581    Author: Deepakkumar Devarajan      Member Level: Gold      Member Rank: 0     Date: 08/Jun/2009   Rating: Revenue Score: 0     Points: 0

Malathi,

I have not seen the preprocessor statement :-) so i thought clrscr() is a predefined function. Well , keep posting questions like this, it'll make us to use our Brain.

Regards,
Deepakkumar D
Join My community :






 
#90346    Author: Akilanda Nageswari       Member Level: Bronze      Member Rank: 5026     Date: 13/Jun/2009   Rating: 2 out of 52 out of 5     Points: 0

100 shown in the output screen


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : C quiz
Previous : netconnect broadband+ - tariff plans
Return to Discussion Forum
Post New Message
Category:

Related Messages

Subscribe to Email
  • Get Jobs by Email
  • Forum posts by Email
  • Articles by Email
  • Online MembersDhairya Khant
    Komal Sood
    Jebaprincy
    Saroja
    rahul
    sageer
    Sudarmani
    vamshi
    Nityananda Hazarika
    Ramprasad
    indurani
    More...


    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    AdSense Revenue Sharing sites   Advertise   Talk to Tony John
    ISC Technologies, Kochi - India. Copyright © All Rights Reserved.