Posts

Showing posts from September 16, 2012

PROGRAM TO SEARCH A ARRAY USING BINARY SEARCH

Image
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],n,item,beg,loc,mid,end,i;
printf("\nEnter size of an array");
scanf("%d",&n);
printf("\nEnter elements of an array in sorted form:\n");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("\n Enter item to be searched");
scanf("%d",&item);

WRITE A PROGRAM TO DETERMINE HOW MANY PRIME-PALLINDROME INTEGERS ARE THERE IN THE RANGE BETWEEN M AND N(BOTH INCLUSIVE ) AND OUTPUT THEM

Image
#include<stdio.h>
#include<conio.h>
void main()
{
int m,n,i,j,count=0,count2=0,nos=0,r=0,nos2=0;

clrscr();
printf("ENTER STARTING AND END POINTS\n");
scanf("%d%d",&m,&n);

PROGRAM TO PRINT COLOURS OF RAINBOW ACCORDING TO THE NO. INPUTTED BY THE USER

Image
#include,stdio.h>
#include<conio.h>
void main()
{
int ch;
printf("INPUT A NUMBER\n");
scanf("%d",&ch);

switch(ch)
{
case 6: printf("Red");
break;
case 5 :
printf(" Orange");
break;
case 4 :
printf(" Yellow");
break;
case 3 :
printf(" Green");
break;
case 2 :
printf(" Blue");
break;
case 1 :
printf(" Indigo");
break;

case 0 :
printf(" Violet");
break;
default : ("wrong input ");

}
}

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 BETWEEN DIFFEREN…