Posts

Showing posts from August 28, 2012

WRITE A PROGRAM TO PRINT ARMSTRONG NOS. FROM 1OO TO 999

Image

WRITE A PROGRAM TO PRINT PRODUCT OF DIGITS

Image

WRITE A PROGRAM TO PRINT COMMISSION OF SALESMAN

Image
#include<stdio.h>
#include<conio.h>
void main()
{
long int sales;
float c=0.0;
clrscr();

printf("ENTER SALES \n");
scanf("%ld",&sales);

if(sales>30000)
c=0.15*sales;
else if(sales<=30000&&sales>22000)
c=0.1*sales;
else if(sales<=22000&&sales>12000)
c=0.07*sales;
else if(sales<=12000&&sales>5000)
c=0.03*sales;
printf("COMMISSION OF THE SALESMAN TO BE RECEIVED = RS. %f",c);

getch();
}

SIMPLE PROGRAMS FIND TYPE OF THE TRIANGLETEMPERATURE CONVERSIONCOMMISSION OF A SALESMANPRINT NUMBERS IN DESCENDING ORDERBIGGEST NUMBER AMONG THREE NUMBERSCALCULATE DIVISIONA YEAR IS LEAP OR NOTA NUMBER IS ODD OR EVEN PRINT THE SQUARE ROOT ELSE PRINT N TO THE POWER 5PRINT A NEW NUMBER BY ADDING 1 TO EACH DIGIT OF THE NUMBER PRINT THE NO. OF CURRENCY NOTES ACCORDING TO THE AMOUNT ENTEREDDATA STRUCTURES ENTER DETAILS OF A STUDENTENTER DETAILS OF A STUDENT USING STRUCTURE WITHIN A STRUCTURE

IMPORTANT EXAMPLES DIFFERENCE BETWE…

WRITE A PROGRAM TO PRINT THREE NOS. IN DESCENDING ORDER

Image
#include<stdio.h>
#include<conio.h>
void main()
{
long int a,b,c,bg;
clrscr();

printf("ENTER THREE NOS.\n");

scanf("%ld%ld%ld",&a,&b,&c);
printf("DESCENDING ORDER \n");
if(a>=b&&a>=c)
{
printf("%d\n",a);
if(b>c)
{
printf("%d\n",b);
printf("%d\n",c);
}
else
{
printf("%d\n",c);
printf("%d\n",b);
}
}
else if(c>=b&&c>=a)
{
printf("%d\n",c);
if(b>a)
{
printf("%d\n",b);
printf("%d\n",a);
}
else
{
printf("%d\n",a);
printf("%d\n",b);
}
}

else
{
printf("%d\n",b);
if(a>c)
{
printf("%d\n",a);
printf("%d\n",c);
}
else
{
printf("%d\n",c);
printf("%d\n",a);
}
}
getch();
}

SIMPLE PROGRAMS FIND TYPE OF THE TRIANGLETEMPERATURE CONVERSIONCOMMISSION OF A SALESMANPRINT NUMBERS IN DESCENDING ORDERBIGGEST NUMBER AMONG THREE NUMBERSCALCULATE DIVISIONA YEAR IS LEAP OR NOTA…