Saturday, July 14, 2018

6. WAP to display the denominations of an amount.

#include<stdio.h>
#include<conio.h>
void main()
{
   int amt,v1,v2,v5,v10,v20,v50,v100,v200,v500,v2000;
   printf("Enter the amount: ");
   scanf("%d",&amt);
   v2000=amt/2000;
   amt=amt%2000;
   v500=amt/500;
   amt=amt%500;
   v200=amt/200;
   amt=amt%200;
   v100=amt/100;
   amt=amt%100;
   v50=amt/50;
   amt=amt%50;
   v20=amt/20;
   amt=amt%20;
   v10=amt/10;
   amt=amt%10;
   v5=amt/5;
   amt=amt%5;
   v2=amt/2;
   amt=amt%2;
   v1=amt;
   printf("\nNo. of 2000 rupees note - %d",v2000);
   printf("\nNo. of 500 rupees note  - %d",v500);
   printf("\nNo. of 200 rupees note  - %d",v200);
   printf("\nNo. of 100 rupees note  - %d",v100);
   printf("\nNo. of 50 rupees note   - %d",v50);
   printf("\nNo. of 20 rupees note   - %d",v20);
   printf("\nNo. of 10 rupees note   - %d",v10);
   printf("\nNo. of 5 rupees note    - %d",v5);
   printf("\nNo. of 2 rupees note    - %d",v2);
   printf("\nNo. of 1 rupee note     - %d",v1);
   getch();

}


OUTPUT:




Please have a look at the below video lesson posted on my 
YouTube channel:

Monday, July 2, 2018

5. WAP to calculate Area and Circumference of a circle.

#include<stdio.h>
#include<conio.h>
void main()
{
   const float pi=3.14;
   int r;
   float ar,c;
   r=5;
   ar=pi*r*r;
   c=2*pi*r;
   printf("Radius = %dcm",r);
   printf("\nArea = %.2fsq. cm",ar);
   printf("\nCircumference = %.2fcm",c);
   getch();
}


OUTPUT:




Please have a look at the below video lesson posted on my YouTube channel:



4. WAP to calculate the Simple Interest.

#include<stdio.h>
#include<conio.h>
void main()
{
   int p;
   float r,t,si;
   p=10000;
   r=4.5;
   t=2.5;
   si=p*r*t/100;
   printf("Simple Interest = %.2f",si);
   getch();
}


OUTPUT:




Please have a look at the below video lesson posted on my YouTube channel:


Sunday, July 1, 2018

3. WAP to display the size of datatypes.

#include<stdio.h>
#include<conio.h>
void main()
{
   short int a;
   char b;
   float c;
   double d;
   printf("\nSize of int - %d", sizeof(a));
   printf("\nSize of char - %d", sizeof(b));
   printf("\nSize of float - %d", sizeof(c));
   printf("\nSize of double - %d", sizeof(d));
   getch();
}


OUTPUT:




Please have a look at the below video lesson posted on my YouTube channel: