Wednesday, March 18, 2020

Write a program to display a grocery bill of the product purchased in the small market by Vijay. Get the following details from Vijay:

  • Session

    Input & Ouput
  • Question ID

    1111110002 : IO 35
  • Problem Description

    Write a program to display a grocery bill of the product purchased in the small market by Vijay. Get the following details from Vijay:

    Get the product name
    Get the price of the product(Price per Unit)
    Get the quantity of the product purchased
    Input and Output Format:

    Refer sample input and output for formatting specification.

    All float values are displayed correct to 2 decimal places.

    All text in bold corresponds to input and the rest corresponds to output.
  • Logic Test Case 1

    Input (stdin)
    soap
    
    33.00
    
    2
    
    
    Expected Output
    Product Details
    
    soap
    
    33.00
    
    2
    
    Bill:66.00
  • Logic Test Case 2

    Input (stdin)
    chocolate
    
    11.11
    
    5
    
    
    Expected Output
    Product Details
    
    chocolate
    
    11.11
    
    5
    
    Bill:55.55







program :

#include<stdio.h>
int main()
{
  char a[12] ;
  float b,d,e;
  int c;
  scanf("%s",a);
  scanf("%f",&b);
  scanf("%d",&c);
  scanf("%f",&d);
  printf("Product Details\n");
  printf("%s\n",a); 
  printf("%.2f\n",b);
  printf("%d\n",c);
  e=b*c;
  printf("Bill:%.2f",e);
  
  return 0;
}

No comments:

Post a Comment

cisco Cybersecurity Essentials Quiz 8 answer in bold

Question  1 Correct Mark 2.00 out of 2.00 Flag question Question text A company has had several incidents involving users downloading unauth...