Delicious Digg Facebook Favorites More Stumbleupon Twitter

Sunday 26 August 2012

if-else condition


                      if-else Condition

                It is used for comparision between only 
                two  variables.

                syntax:- 
    
                             if(condition)
                             {
                                  statements;
                              }
                              else
                              {
                                  statements;
                               }

                  Example:-  
                                    #include<stdio.h>
                                    main()
                                   {
                                      int a,b;
                                      clrscr();
                                      printf("enter a,b values:");
                                      scanf("%d%d",&a,&b);
                                      if(a>b)
                                      printf("a is big");
                                      else
                                      printf("b is big");
                                      getch();
                                   }

                 


output:-

           





                          

0 comments:

Post a Comment