jag3048
BAN USER- 0of 0 votes
Answershow to retrieve particular duplicate element of all rows from a table using linq
- jag3048 in United States
Example:
siteId name
2 a
2 b
4 c
4 d
6 e
6 f
i need for each iteration we have to print all rows of particular siteId element.
suppose: for first iteration we have to print rows like:-
2 a
2 b
Using Linq in c#| Report Duplicate | Flag | PURGE
- 0of 0 votes
Answersprint the numbers without repeating digits in it and with in the range x to y.
- jag3048 in United States
ex. range 50 to 5000,
then it must print like 50,51,52,53,54,56,....57,......65,67,....76,77....109,120,123,124...4987.
not like 556,55, .avoid duplicate digits in number.| Report Duplicate | Flag | PURGE
#include<stdio.h>
#include<conio.h>
int sa(int);
int main()
{
int n,y,a;
printf("enter the value\n");
scanf("%d",&n);
printf("enter upper value\n");
scanf("%d",&a);
int i=n;
for( i=n;i<a;i++)
{
y=sa(i);
if(y==1)
{
printf("%d\t",i);
}
}
printf("\n");
getch();
return 0;
}
int sa(int x)
{
int r=0,a[10],i=0,j=0;
int flag=1;
for(i=0;i<=9;i++)
a[i]=11;
i=0;
while(x>0&&flag==1)
{
r=x%10;
j=0;
while(a[j]!=11&& i>=1)
{
if(a[j]==r)
{
flag=0;
break;
}
j++;
}
x=x/10;
a[i]=r;
i++;
}
if(flag==1)
return 1;
else
{
flag=1;
return 0;
}
}
#include<stdio.h>
#include<conio.h>
int main()
{
int a[]={1,0,1,0,0,1,1,1,0};
int b[]={1,0,1.0,0,1,1,1,0,1,0},m,n;
m=9,n=11;
int x,y,i,j;
int acunt_0=0,acunt_1=0,bcunt_0=0,bcunt_1=0;
for( i=0;i<n;i++)
{
if(b[i]==0)
bcunt_0++;
else
bcunt_1++;
for( j=m-1;j>=0;j--)
{
if(a[j]==0)
{
acunt_0++;
break;
}
else
{
acunt_1++;
break;
}
printf(" bcount value %d\n", acunt_0);
//break;
}
if(acunt_0==bcunt_0 && acunt_1==bcunt_1)
{
x=i,y=j;
printf("fond %d\t fond%d\n",x,y);
break;
}
else
{
m--;
}
}
getch();
return 0;
}
or we can do it by using hashing...
- jag3048 August 13, 2013