SCC52121||CHAAR

#include <bits/stdc++.h>
using namespace std;

int main() {
int t;
cin>>t;
for(int i=0;i<t;i++){
int n;
cin>>n;
int rem = 0;
int count = 0;
while(n>0){
rem = n%10;
n=n/10;
if(rem==4){
count ++;
}
else{
continue;
}
}
cout<<count<<endl;
}
return 0;
}

//ChaarKaChakkar
//ProblemCode=CHAAR

I think this will work for you:

#include <bits/stdc++.h>
using namespace std;

int main() {
int t;
int n;
int rem = 0;
int count = 0;
cin>>t;
for(int i=0;i<t;i++){
cin>>n;
while(n>0){
rem = n%10;
n=n/10;
if(rem==4){
count ++;
}
}
}
cout<<count;
return 0;
}

And can you discuss the problem properly !!