/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/
#include<stdio.h>
main()
{
int n,i,a,in=0,out=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a);
if(a>=10&&a<=20)
{
in++;
}
else
out++;
}
printf("%d in\n%d out\n",in,out);
return 0;
}
//Happy_Coding
#include<stdio.h>
main()
{
int n,i,a,in=0,out=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a);
if(a>=10&&a<=20)
{
in++;
}
else
out++;
}
printf("%d in\n%d out\n",in,out);
return 0;
}
No comments:
Post a Comment