Thursday, June 3, 2021

Super Market billing in C programming|C PROGRAMMING|R2C TECHNOLOGIES



SUPER MARKET BILLING

         In this tutorial we are going to see how to do a simple super market billing program. Let us see the program…

*   We are using  <stdio.h> to get the standard input and output of the program and as a variable here we are using  item , chocolate , chocolates  , biscuit , biscuits and sum.

*   We are declaring chocolates=20 and in print statement we are giving enter the no of chocolates and now we are using scanf to give the input for the above print statement.

*   Now we are declaring chocolates = Items*chocolate to get the value for the total no of chocolates we are entering.

*   We have to follow  the same things for the biscuits also.

*   At last we are printing the bill so we print the statement super market and then next statement item  and price.

*   We are using \t  for the tab and we are using \n for new line.

*   At the sum we are adding the total values to give the bill amount.

We are using return 0 to declare 



Program:

#include <stdio.h>

int main()

{

    int item,chocolate,chocolates,biscuit,biscuits,sum;

    chocolate=20;

    printf("Enter the no of chocolates : ");

    scanf("%d",&item);

    chocolates=item*chocolate;

    biscuit=20;

    printf("Enter the no of biscuits : ");

    scanf("%d",&item);

    biscuits=item*biscuit;

    printf("Super Market\n");

    printf("Item\t\tPrice\n");

    printf("chocolates\t%d\nbiscuits\t%d\n",chocolates,biscuits);

    sum=chocolates+biscuits;

    printf("The total bill amount is : %d ",sum);

    scanf("%d",&sum);

    return 0;

}

 


USD TO INR C++ PROGRAMMING

  NALLAMUTHU GOUNDER MAHALINGAM COLLEGE                                                 POLLACHI-642001                                     ...