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

ArticlesPractice TestsAsk ExpertsQuestion PapersJobsUniversitiesCollegesCoursesSchoolsTraining

Active Members
TodayLast 7 Daysmore...

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




Forums » Education » General »

C quiz


Posted Date: 05 Jun 2009      Posted By:: Malathi     Member Level: Silver    Member Rank: 3948     Points: 1   Responses: 3



main()
{
int c[ ]={2.8,3.4,4,6.7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++) {
printf(" %d ",*c);
++q; }
for(j=0;j<5;j++){
printf(" %d ",*p);
++p; }
}




Responses

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

Hi Malathi,

It might cause an error , as variable c is not a pointer . i am not sure about it . Please join my community and post the same

http://www.indiastudychannel.com/sites/152280/-Tech-World.aspx

Regards,
Deepakkumar D
Join My community :



 
#88929    Author: Gopal Bhageria      Member Level: Bronze      Member Rank: 0     Date: 05/Jun/2009   Rating: 2 out of 52 out of 5     Points: 3

Does not give an error. The answer to this is:- 2222228344
*) c in itself is a pointer to the first element of an array.
*) the first loop prints *c without incrementing c itself, hence only 2 gets printed for each iteration
*) for the second loop, as p is incremented as well, it gets incremented by one array position and hence, the array is iterated.



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

The answer to this is:- 2222228344





 
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 : This site is useful for geting more information about education
Previous : Solve it easy c question
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 MembersAnand Gaurav
    Aditya
    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.