/*Serial No.85 [swami59.cpp]*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,num,flag=0,arr[5];
printf("Enter 5 numbers for array:=\n");
for(i=0;i<5;i++)
{
scanf("%d",&arr[i]);
}
printf("Enter number u want to search:=");
scanf("%d",&num);
for(i=0;i<5;i++)
{
if(arr[i]==num)
{
printf("number %d do exist in present array",num);
flag=1;
break;
}
}
if(flag==0)
{
printf("number does not exist in the present array");
}
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int i,num,flag=0,arr[5];
printf("Enter 5 numbers for array:=\n");
for(i=0;i<5;i++)
{
scanf("%d",&arr[i]);
}
printf("Enter number u want to search:=");
scanf("%d",&num);
for(i=0;i<5;i++)
{
if(arr[i]==num)
{
printf("number %d do exist in present array",num);
flag=1;
break;
}
}
if(flag==0)
{
printf("number does not exist in the present array");
}
getch();
}
No comments:
Post a Comment
If you have any doubt, feel free to ask...