As promised, improved version of the code:
#include<stdio.h>
#include<string.h>
#define MAX_STR_SIZE 100
int main()
{
int num;
int state;
int a, b;
printf("Enter amount data: ");
scanf("%d", &num);
int data[num];
char element[num][MAX_STR_SIZE];
for(a=0;a<num;a++)
element[a][0]='\0';
for(a=0;a<num;a++)
{
printf("Enter state: ");
scanf("%d", &state);
if(state == 3)
strcat(element[0],"A");
else if(state == 10)
strcat(element[1],"B");
}
printf("Elements are: ");
for(b=0;b<num;b++)
printf(" %s",element[b]);
return 0;
}
If you want your number of elements to be other than equal to variable num then replace "num" in lines
char element[num][MAX_STR_SIZE];
for(a=0;a<num;a++)
with whatever you'd like.