i think from the title you will get what i mean
my code is the following one ..but i need your help to see if the logic i used is correct:
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i,j,t[5];
printf("enter the first element:\n");
scanf("%d",&t[0]);
for(i=1;i<4;i++)
{ printf("enter the element:\n");
scanf("%d",&t);
for(j=0;j<i;j++)
if(t[j]==t)
{printf("retype an other integer:\n");
scanf("%d",&t);
}
}
for(i=0;i<4;i++)
printf("%d",&t);
return 0;
}
cordially
my code is the following one ..but i need your help to see if the logic i used is correct:
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i,j,t[5];
printf("enter the first element:\n");
scanf("%d",&t[0]);
for(i=1;i<4;i++)
{ printf("enter the element:\n");
scanf("%d",&t);
for(j=0;j<i;j++)
if(t[j]==t)
{printf("retype an other integer:\n");
scanf("%d",&t);
}
}
for(i=0;i<4;i++)
printf("%d",&t);
return 0;
}
cordially