Exforsys
+ Reply to Thread
Results 1 to 4 of 4

c programming

This is a discussion on c programming within the C and C++ forums, part of the Programming Talk category; main() { int c=--2; printf("c=%d",c); } y there is an compiler error...

  1. #1
    amit sorot is offline Junior Member Array
    Join Date
    Aug 2011
    Answers
    1

    c programming

    main()
    {
    int c=--2;
    printf("c=%d",c);
    }

    y there is an compiler error


  2. #2
    ssi12345 is offline Junior Member Array
    Join Date
    Sep 2011
    Answers
    1
    int c=--2;
    It should be c=(-2)


  3. #3
    bigclassesglobal is offline Junior Member Array
    Join Date
    Sep 2011
    Location
    INDIA
    Answers
    10
    why had u given as '--2', give it as -2,and once check it


  4. #4
    Sandhya.Kishannag is offline Member Array
    Join Date
    Feb 2012
    Answers
    66
    I think it should be given as

    int c;
    c=--2;
    printf("%c=%d",c)

    -- is the decrement operator


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...