Skip to main content

John made a huge profit out of his grocery shop. But, his profit got reduced due to his wrong calculation in providing the balance amount to his customers.

 John made a huge profit out of his grocery shop. But, his profit got reduced due to his wrong calculation in providing the balance amount to his customers.

Once he started to realize his mistakes, he is trying to make out this work with his robot. So that his profit is safe.

He finds you to provide a programming solution to his problem. Get purchase value and cash given by the customer and calculate the balance amount.

Input format

Two positive integers,

First one is the purchase value and other one is the Cash given by the customer in each line

Output format

Numerical value which is the balance amount to be given back to the Customer


Note: Printing unwanted or ill-formatted data to output will cause the test cases to fail

Sample testcases
Input 1
28
100
OUTPUT
#include<stdio.h>
#include<stdlib.h>
int main()
{
    int purchase=0;
    int cash=0;
    scanf("%d",&purchase);
    scanf("%d",&cash);
    printf("%d",cash-purchase);
    return 0;
}

Comments

Popular posts from this blog

Write functions to implement string operations such as compare, concatenate, string length. Convince the parameter passing techniques Program and Algorithm Computer Science Engineering VTU

STRINGconcatenation #include<stdio.h> #include<stdlib.h> int length (char str[]); int compare (char str1[],char str2[]); void concatenate (char str1[],char str2[]); void main() { char str1[30],str2[30]; int choice,a,i,j; printf("enter 1-string comparision\n"); printf("enter 2-string length\n"); printf("enter 3-string concatenation\n"); printf("enter 4-exit\n"); scanf("%d",&choice); switch(choice) { case 1:printf("enter string 1\n"); scanf("%s",str1); printf("enter string 2\n"); scanf("%s",str2); a=compare(str1,str2); if(a==0) { printf("%s and%s are identical\n",str1,str2); } else { printf("%s and%s are not identical\n",str1,str2); } break; ...

Select the option that is most nearly OPPOSITE in meaning to the word or phrase is given in bold. Birds are quarantined to prevent the spread of bird flu.

Select the option that is most nearly OPPOSITE in meaning to the word or phrase is given in bold. Birds are  quarantined  to prevent the spread of bird flu. immunized butchered secluded CORRECT mingled