Discussion Week 1

2nd Assignment

2nd Assignment

by Alimozzaman Durjoy -
Number of replies: 1

can anyone share the sample input-output of 2nd assignment(duplicate value) please?

In reply to Alimozzaman Durjoy

Re: 2nd Assignment

by akibul hasan -
#include
int main()

{
int m[50],a,b,c;

printf("How many numbers you want to take :");
scanf("%d",&c);
printf("Enter the numbers : ");
for(a=0; a scanf("%d",&m[a]);
printf("Enter the number you want to search :");

scanf("%d",&b);
for(a=0; a {


if(m[a]==b)
{
printf("the number is %d",a+1);

break;
}


}
if(a==c)
printf("Not found\n");


printf("total number of elements : %d",c);

}