Adetutu

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • in reply to: calculate and display mpg in C program #3496

    Adetutu
    Participant

    Hello dman,
    If I am understanding your program correctly, It will not calculate overall average of miles/gallon. If you want to calculate average, you need to keep track number of inputs, and perform addition of each calculation of miles/gallon and then divide sum from number of input.

    for eg For given 3 input 22.421875 ,19.417475 ,24.000000

    overall average = (22.421875 + 19.417475 + 24.000000)/3

    I didn’t run this program on any compiler but somehow i am not able to see this average calculation in the program.

    Please feel free to revert back.
    Gaurav

  • in reply to: calculate and display mpg in C program #3494

    Adetutu
    Participant

    HI Dman,
    Please confirm me. How will this code calculate Overall Average MIles/Gallon used which is last statement of program?

    I fear that it is missing.

    Thanks
    Gaurav

  • in reply to: Help with this C coding #3485

    Adetutu
    Participant

    I hope this is program of you assignment. :lol: Any way If you want to calculate 2 to power n(2^n) Please try this piece of code.

    /***********************************************
    Program to Calculate 2 to power n (2^n)
    ***********************************************/
    #include
    int main()
    {
    int n, i , pow = 1;

    printf(“Enter the number (n):: “);
    scanf(“%d” , &n);
    for(i = 0; i < n; i++)
    {
    pow = pow * 2;
    }
    printf(“Result is :: %d”, pow);
    }

    Please feel to revert back.
    Thanks
    Gaurav

  • in reply to: Reading input string #3398

    Adetutu
    Participant

    Actually your code is right. However from your messgae it is not clear what the problem is?
     
    Well check the herader file name. It must be second opening curley braces ({) after main().
     
    Kindly wirite specific problem

  • in reply to: Detail about How VPTR and Virtual table works #3345

    Adetutu
    Participant

    Hi,

    Please confirm on which platform you are testing your program. On TurboC3 it has some diffrent output. I hope You are using gcc compiler on linux or solaris
  • in reply to: #3390

    Adetutu
    Participant

    Hi,

    Can I test your this program on Linux gcc compiler and Turboc3 on DOS.

    Thanks
  • in reply to: How this code works? #3381

    Adetutu
    Participant

    WinkMost welcome at any time dude Clap

  • in reply to: How this code works? #3379

    Adetutu
    Participant

    This is simple a structure. What type of help you are looking for?

    This is simple structure with some pointer notation. Tell your exact problem.Smile
  • in reply to: You must specify a subject when posting a new topic. #3388

    Adetutu
    Participant

    Thanks buddy. I have used all the methods but was not aware about these terms.

  • in reply to: Please Help. Correct "Mark up Language" Tags. #3372

    Adetutu
    Participant

    Hi,
    This is not a big problem. One way is suggested to use recursion. Another way is that you can make your own Stack.
     
    Push and pop are the operations of a Stack. When you insert a value in stack it is push and when you fetch the value from stack it is pop. the basic concept of a stack is First in Last out.
     
    Please don’t say that you can not make a program of these operation. If you are doing such programming then you must aware about stack.
     
    Another thing you would need is File handling in case you use real mark up files. For mark up language, You can see any web page. Basi markup language is HTML.
     
    Feel free to revert back if still has confusion.
     
    Bye 

Viewing 10 posts - 1 through 10 (of 10 total)