In pbl life,the universe and everything,how we can check that it should be only 1 or 2 digit no?

#include <stdio.h>
#include <stdlib.h>

int main()
{
int a[20],i,n;
printf(“how many no. u wanna enter?\n”);
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);

}
printf("after processing\n");
 for(i=0;i<n;i++)
{
    printf("%d\n",a[i]);
    if(a[i]==42)
        break;
}
return 0;

}

That helper text is useless and it will give you WA…

To check for such condition, it’s simple:

Use 2 assert statements…

One checking from 0 to 9 (covers 1-digit numbers)

Other checking for 10 to 99 (covers 2-digit numbers)

Although, you must know, this is not necessary