This blog is under construction

Sunday 12 January 2014

#if, #elif, #else and #endif example

#if
If the resultant value of the arithmetic expression is non-zero, then the code between #if and #endif will be compiled.

Example:
#if 10 > 5
     printf("10 is greater than 5");
#endif

The code between #if and #endif will be compiled since the resultant value of the expression(10 > 5) is non-zero.


#elif
This provides an alternate expression to evaluate

Example:
#if 10 < 5
     printf("10 is less than 5");
#elif 10 > 5
     printf("10 is greater than 5");
#endif

The expression at #if directive evaluates to 0.  So, the expression at #elif is evaluated. If it is non-zero, then the code between #elif and #endif will be compiled.


#else
If the resultant value of the arithmetic expression is false for #if, #ifdef or #ifndef, then the code between #else and #endif will be compiled.

Example:
#if 10 < 5
     printf("10 is less than 5");
#else
     printf("10 is greater than 5");
#endif


#endif
This acts as an end directive for #if, #ifdef, #ifndef, #elif or #if

#if 100 < 50   // resultant value of expression is 0
   printf("#if directive");
#elif 50 < 10  // resultant value of the expression is 0
    printf("#elif directive");
#else
    printf("#else directive");  // this statement would be executed
#endif

Example C program to illustrate #if #elif #else #endif usage in C:

  #include <stdio.h>
  #define VAL1 10
  #define VAL2 20
  #define VAL3 30

  int main() {
    #if VAL1 > VAL2
          printf("%d is greater than %d\n", VAL1, VAL2);
    #elif VAL1 > VAL3
          printf("%d is greater than %d\n", VAL1, VAL3);
    #else
          printf("%d is less than %d and %d\n", VAL1, VAL2, VAL3);
    #endif
    return 0;
  }

  Output:
  jp@jp-VirtualBox:~/$ ./a.out
  10 is less than 20 and 30




13 comments:

  1. if Val1 = Val2 = Val3 What will happen???

    ReplyDelete
    Replies
    1. Hello Everyone !

      USA SSN Leads/Dead Fullz available, along with Driving License/ID Number with good connectivity.

      All SSN's are Tested & Verified.

      **DETAILS IN LEADS/FULLZ**

      ->FULL NAME
      ->SSN
      ->DATE OF BIRTH
      ->DRIVING LICENSE NUMBER
      ->ADDRESS WITH ZIP
      ->PHONE NUMBER, EMAIL
      ->EMPLOYEE DETAILS

      *Price for SSN lead $2
      *You can ask for sample before any deal
      *If you buy in bulk, will give you discount
      *Sampling is just for serious buyers

      ->Hope for the long term business
      ->You can buy for your specific states too

      **Contact 24/7**

      Whatsapp > +923172721122

      Email > leads.sellers1212@gmail.com

      Telegram > @leadsupplier

      ICQ > 752822040

      Delete
  2. Nice article admin thanks for share your atricle keep share your knowledge i am waiting for your new post check mens winter jackets polo shirts kindly review and reply me

    ReplyDelete
  3. Hello Everyone !

    USA SSN Leads/Dead Fullz available, along with Driving License/ID Number with good connectivity.

    All SSN's are Tested & Verified.

    **DETAILS IN LEADS/FULLZ**

    ->FULL NAME
    ->SSN
    ->DATE OF BIRTH
    ->DRIVING LICENSE NUMBER
    ->ADDRESS WITH ZIP
    ->PHONE NUMBER, EMAIL
    ->EMPLOYEE DETAILS

    *Price for SSN lead $2
    *You can ask for sample before any deal
    *If you buy in bulk, will give you discount
    *Sampling is just for serious buyers

    ->Hope for the long term business
    ->You can buy for your specific states too

    **Contact 24/7**

    Whatsapp > +923172721122

    Email > leads.sellers1212@gmail.com

    Telegram > @leadsupplier

    ICQ > 752822040

    ReplyDelete
  4. Dell Laptop Repair Center in Noida is no.1 service center which provides door to door services in or its nearby areas. We have expert, technicians who can repair your laptop at your home. . Call us: 9891868324

    ReplyDelete
  5. **SELLING SSN+DOB FULLZ**

    CONTACT 24/7
    Telegram > @leadsupplier
    ICQ > 752822040
    Email > leads.sellers1212@gmail.com

    >>1$ each without DL/ID number
    >>2$ each with DL
    >>5$ each for premium (also included relative info)

    Price will be reduce in Bulk order

    FORMAT OF LEADS/FULLZ/PROS

    ->FULL NAME
    ->SSN
    ->DATE OF BIRTH
    ->DRIVING LICENSE NUMBER WITH EXPIRY DATE
    ->COMPLETE ADDRESS
    ->PHONE NUMBER, EMAIL, I.P ADDRESS
    ->EMPLOYMENT DETAILS
    ->REALTIONSHIP DETAILS
    ->MORTGAGE INFO
    ->BANK ACCOUNT DETAILS

    >All Leads are Spammed & Verified.
    >Fresh spammed data of USA Credit Bureau
    >Good credit Scores, 700 minimum scores
    >Invalid info found, will be replaced.
    >Payment mode BTC, ETH, LTC, PayPal, USDT & PERFECT MONEY

    ''OTHER GADGETS PROVIDING''

    >SSN+DOB Fullz
    >CC with CVV
    >Photo ID's
    >Dead Fullz
    >Carding Tutorials
    >Hacking Tutorials
    >SMTP Linux Root
    >DUMPS with pins track 1 and 2
    >Sock Tools
    >Server I.P's
    >HQ Emails with passwords

    Contact 24/7

    Email > leads.sellers1212@gmail.com
    Telegram > @leadsupplier
    ICQ > 752822040

    ReplyDelete
  6. An fascinating dialogue is worth comment. I believe that you must write extra on this matter, it may not be a taboo subject but generally people are not enough to talk on such topics. To the next. app kosten berlin

    ReplyDelete


  7. I was searching for loan to sort out my bills& debts, then i saw comments about Blank ATM Credit Card that can be hacked to withdraw money from any ATM machines around you . I doubted thus but decided to give it a try by contacting { cchacker0002@gmail.com} they responded with their guidelines on how the card works. I was assured that the card can withdraw $5,000 instant per day & was credited with $20,000 so i requested for one & paid the delivery fee to obtain the card, after 24 hours later, i was shock to see the UPS agent in my resident with a parcel{card} i signed and went back inside and confirmed the card work's after the agent left. This is no doubts because i have the card & has made used of the card. This hackers are USA based hackers set out to help people with financial freedom!! Contact these email if you wants to get rich with this Via: cchacker0002@gmail.com

    ReplyDelete
  8. This blog is very informative and interesting. I really got a lot of information about programming. Thanks for sharing this blog. Now it's time to avail HALFCASTE CREAM SET for more information.

    ReplyDelete
  9. A few months ago, I was swindled off $378,000 worth of BTC, I was coined by someone who pretended to be a Forex trader online and convinced me to invest in cryptocurrency. I couldn’t withdraw my profits or my initial investment and he kept requesting more fees, to cut the story short I lost all my money which was very depressing for me. While I was confiding with my colleagues at work about the whole situation, I was referred to SpyWeb, a trustworthy group of developers and hackers who could help me recover my stolen funds and help me get these scammers. Without any doubt, I contacted SpyWeb and provided all the information, including their wallet addresses. To my surprise, SpyWeb was able to recover my money in 72 hours which was unbelievable, I’m super excited because I didn’t imagine ever getting back my money. I’ll advise others out there to seek more knowledge before investing in cryptocurrency and if you’ve been in my situation, you should reach out to SpyWeb. They can assist you to recover your money.

    Reach SpyWeb Via E-Mail: Spyweb@Cyberdude(.)com & Contact@Spyweb(.)tech
    Telegram: @SpyWebCyber

    ReplyDelete