Beginners Tutorial : The C-language.

Discussion in 'Computer Science | IT | Networking' started by simplycoder, Aug 19, 2011.

    SamiZzY Certified CEan

    Message Count:
    10
    Ratings Received:
    +0
    Engineering Discipline:
    Electronics & Telecommunications
    i replaced the l.h.s index with original index int the last line(is that what you meant?:confused: ) , and the output was 24 and 81. pretty strange because index changes from 100 to 999 but thankyou for the reply mr.jeffrey :)

    Conqueror Ace

    Message Count:
    1,934
    Ratings Received:
    +192
    Engineering Discipline:
    Electronics
    Code:
    for(index2=1;index2<=3;index2++)
    {
    digit=index%10;// Replace this index
    final_ans=final_ans+pow(digit,3);
    index=index/10;// and also here both the index has to be varied
    }
    Cos your program is having a logical error since you are manipulating the the control variable of the outer loop in the inner most loops So you are getting an error here
    • Like Like x 1

    SamiZzY Certified CEan

    Message Count:
    10
    Ratings Received:
    +0
    Engineering Discipline:
    Electronics & Telecommunications
    thankyou sir.! noting what you said , replaced all the var index with original index in the 2nd loop
    and at the bottom if condition replaced original index with var index and by god's grace it worked .!
    thankyou again.

    Conqueror Ace

    Message Count:
    1,934
    Ratings Received:
    +192
    Engineering Discipline:
    Electronics
    It is my pleasure to help you Pls avoid Siring me I ama student just like you

    We are all are here to help you and learn from you
    • Like Like x 1

    Ashish Saklani Certified CEan

    Message Count:
    4
    Ratings Received:
    +0
    Engineering Discipline:
    Computer Science
    thank u simplycoder this tutorials will help me in programming.

    simplycoder Maniac

    Message Count:
    297
    Ratings Received:
    +97
    Engineering Discipline:
    Electronics & Communications
    Its glad to hear.

    lit-857 Apprentice

    Message Count:
    10
    Ratings Received:
    +0
    Engineering Discipline:
    IT
    sir u should give the ans of exersies

    simplycoder Maniac

    Message Count:
    297
    Ratings Received:
    +97
    Engineering Discipline:
    Electronics & Communications
    The best part about programming is that you know the correct answer.
    If you follow the tutorial throughout then I think you wouldn't find it difficult(challenging has a different meaning.)

    Still if you don't get the output, show your work and then we can debug it or see where it goes wrong.

    Tip:The best way to solve is to execute it by hand for small input.

    lit-857 Apprentice

    Message Count:
    10
    Ratings Received:
    +0
    Engineering Discipline:
    IT
    what d/f b/w float and double datatype

    Conqueror Ace

    Message Count:
    1,934
    Ratings Received:
    +192
    Engineering Discipline:
    Electronics
    float datatype allows only 4 bytes of memory Whereas the double type allows 8 bytes

    Only the range of these two differs not their other types

    lit-857 Apprentice

    Message Count:
    10
    Ratings Received:
    +0
    Engineering Discipline:
    IT
    i know very well but i want to get understend with exmple

    Ganesh MSD Apprentice

    Message Count:
    46
    Ratings Received:
    +1
    Engineering Discipline:
    Computer Science
    Nice article...!! This is simply awesome. So useful.

    Ganesh MSD Apprentice

    Message Count:
    46
    Ratings Received:
    +1
    Engineering Discipline:
    Computer Science
    Nice article...!! This is simply awesome. So useful.

Share This Page