Posts

c\c++ program for the greatest number.

  #include <stdio.h> int main (){     int a , b , c , d ;     printf ( "enter first number" );     scanf ( " %d " , & a );     printf ( "enter first number" );     scanf ( " %d " , & b );     printf ( "enter first number" );     scanf ( " %d " , & c );     printf ( "enter first number" );     scanf ( " %d " , & d );     if ( a < b )     {         if ( b < c )         {             if ( c < d )             {                 printf ( " %d is a greatest number." , d );             }             else { printf ( " %d is a greatest number." , c );}                     }       ...

C/C+= program to calculate Income tax

\\ program to calculate income tax    #include <stdio.h> int main (){     int sal , cusno ;     printf ( "Enter the customer number: " );     scanf ( " %d " , & cusno );     printf ( "Enter your salary: " );     scanf ( " %d " , & sal );     if ( sal < 250000 ){         printf ( "Net tax is 0" );     }     else if ( sal > 250000 && sal < 500000 )     {         printf ( "Net tax is %d ." , ( sal - 250000 ) * 5 / 100 );     }     else if ( sal >= 500000 && sal < 1000000 )     {         printf ( "Net tax is %d ." , ( sal - 500000 ) * 20 / 100 );     }     else {         printf ( "Net tax is %d ." , ( sal - 1000000 ) * 30 / 100 );     }     return 0 ;         }

C/C++ program for result making

// Program to calculate a student result of three subjects.    #include <stdio.h> int main (){     int physics , chemistry , maths ;     float total ;     printf ( "Enter Physics marks:" );     scanf ( " %d " , & physics );     printf ( "Enter Chemistry marks:" );     scanf ( " %d " , & chemistry );     printf ( "Enter Maths marks:" );     scanf ( " %d " , & maths );     total = ( physics + chemistry + maths );     if ( total < 40 || physics < 33 || chemistry < 33 || maths < 33 )     {         printf ( "Your total percentage is %f and You are FAIL \n " , total / 3 );     }     else { printf ( "Your total percentage is %f and You are PASS \n " , total / 3 );}     }

C/C++ programs(use of int,float and char)

##Here int--> integers, float-->decimal no., char--> character to print this all we can use %d, %f and %s respectively #include <stdio.h> int main (){     int a = 4 ;     float b = 8.5 ;     char c = 'u' ;     printf ( "the value of a is %d \n " , a );     printf ( "the value of b is %f \n " , b );     printf ( "the value of c is %c \n " , c );     printf ( "sum of a and b is %f \n " , a + b );     return 0 ; }