Hey sorry buddy...here is the code

#include<stdio.h>
#include<conio.h>

void main()
{
int a[20],loop1,loop2,temp,num; // INITIALIZATION

printf("ENTER THE ARRAY SIZE");
scanf("%d",&num);

printf("ENTER THE NUMBERS");

for(loop1=0;loop1<num;loop1++)
{
scanf("%d",&a[loop1]);
}



for(loop1=0;loop1<num;loop1++)
{
for(loop2=0;loop2<num;loop2++)  // SORTING
{
if(a[loop1]>a[loop2])
{
temp=a[loop1];
a[loop1]=a[loop2];
a[loop2]=temp;
}
}
}

for(loop1=0;loop1<num;loop1++)  // CONDITION CHECKING
{
if(a[loop1]==a[loop1+1]+1)
    {
    printf("TWO NUMBERS ARE %d, %d and their sum is
%d",a[loop1],a[loop1+1],a[loop1]+a[loop1+1]);
    loop2=0;
    break;
    }
}
if(loop2!=0)
{
printf("NO SUCH ENTRIES FOUND");
}
getch();
}




On Sun, Sep 19, 2010 at 11:57 AM, Krunal Modi <krunalam...@gmail.com> wrote:

> @LG JAYARAM :
>
> Your code is not even compiling. If you are including header that
> means you have made a code and successfully run it.
> I have the code ready....but just wanted to check with your program
> for some exception conditions...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to