Beginners Tutorial : The C-language :: Discussions

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

    Engg.Dee Apprentice

    Message Count:
    46
    Ratings Received:
    +6
    Engineering Discipline:
    Industrial
    okk.............!

    Vishal0203 Apprentice

    Message Count:
    240
    Ratings Received:
    +53
    Engineering Discipline:
    Computer Science
    the i modification statements are undefined. Different compilers may produce different outputs which cannot be judged. The pre-, -post increments are not supposed to be used in this way since the main reason for using the increments is controlling the loops. The above snippet causes ambiguity or confusion to the compiler as the same value is being incremented in several ways. hence, different compilers produce different outputs!
    • Like Like x 1

    Vishal0203 Apprentice

    Message Count:
    240
    Ratings Received:
    +53
    Engineering Discipline:
    Computer Science
    the i modification statements are undefined. Different compilers may produce different outputs which cannot be judged. The pre-, -post increments are not supposed to be used in this way since the main reason for using the increments is controlling the loops. The above snippet causes ambiguity or confusion to the compiler as the same value is being incremented in several ways. hence, different compilers produce different outputs!

    Vishal0203 Apprentice

    Message Count:
    240
    Ratings Received:
    +53
    Engineering Discipline:
    Computer Science
    Okay guys Here's a simple question!!
    QUE:: Write a program to make a number HALF without using ' / '

    Post your code snippets! :)

    sulochana anand Apprentice

    Message Count:
    59
    Ratings Received:
    +5
    Engineering Discipline:
    IT
    as my knowledge is concern if increment is applied three or more than three it increse twice in value.

    sulochana anand Apprentice

    Message Count:
    59
    Ratings Received:
    +5
    Engineering Discipline:
    IT
    am also agree that increment nd decrement op are used in loop.so no need more discussion over it.diffrent compiler may give diffrent result.its also true.

    sulochana anand Apprentice

    Message Count:
    59
    Ratings Received:
    +5
    Engineering Discipline:
    IT
    can v try it as following sir?hahaha
    int i=20;
    printf(i>>1);

    Vishal0203 Apprentice

    Message Count:
    240
    Ratings Received:
    +53
    Engineering Discipline:
    Computer Science
    sir?? o_O I'm just a 2nd year student :sick:
    by the way, your code just needs a quoted %d in printf() statement, everything is fine after that. haha :D

    Any other ways to do it?? :sneaky:

    sulochana anand Apprentice

    Message Count:
    59
    Ratings Received:
    +5
    Engineering Discipline:
    IT
    yes u r write

    123_neha Certified CEan

    Message Count:
    21
    Ratings Received:
    +4
    Engineering Discipline:
    IT
    try this code for first inverted triangle
    for(i=5;i>=1;i--)
    {
    for(j=1;j<=i;j++)
    {
    cout<<" "<<"*"<<" ";
    }
    cout<<endl;
    }

    you can do the second one by simply reversing the above loops

    rahul69 Maniac

    Message Count:
    349
    Ratings Received:
    +79
    Engineering Discipline:
    IT
    This logic does not work on the floating point numbers..(i think..) . A much simpler and effective way is this:
    no=no*0.5;
    :cool:

    sulochana anand Apprentice

    Message Count:
    59
    Ratings Received:
    +5
    Engineering Discipline:
    IT
    th
    thanx i learned new thing.my math is not so good.

    Conqueror Ace

    Message Count:
    1,973
    Ratings Received:
    +194
    Engineering Discipline:
    Electronics
    Do you mean to say that you forgot your password for Win 7

    Just remove the Cmos battery in the desktop that will reset all your passwords

    Brainy Certified CEan

    Message Count:
    5
    Ratings Received:
    +1
    Engineering Discipline:
    Electrical & Electronics
    hello engineers, how are you all? Nice to meet you all here again.

    Chinu1 Certified CEan

    Message Count:
    58
    Ratings Received:
    +1
    Engineering Discipline:
    Computer Science
    Thanks.. Please tell me about library function. And what the major difference between C and C++.

    sulochana anand Apprentice

    Message Count:
    59
    Ratings Received:
    +5
    Engineering Discipline:
    IT
    i want to know how any number multiplied by 0.5 becomes half.

    Conqueror Ace

    Message Count:
    1,973
    Ratings Received:
    +194
    Engineering Discipline:
    Electronics
    Hey there .5 = 5/10 = 1/2

    Hope you got it

    But this is not a place to start fresh ideas buddy try to shift your new questions to threads

    sulochana anand Apprentice

    Message Count:
    59
    Ratings Received:
    +5
    Engineering Discipline:
    IT
    thanx i got it.mens if v want to make half 13.then 13*0.5=6.5.0.5=5/10=1/2*13=6.5.right!

    Conqueror Ace

    Message Count:
    1,973
    Ratings Received:
    +194
    Engineering Discipline:
    Electronics
    I am confused in your statement but the last part of your answer works the way you say

    suchismith roy Certified CEan

    Message Count:
    1
    Ratings Received:
    +0
    Engineering Discipline:
    Computer Science
    what will be the output and why
    main()
    {
    if(2,1,0)
    printf("yes");
    else
    printf("no");



    the output comes as no..as i have compiled it ...plz expalin me how

Share This Page