In while, i'm expected that in every loop it will take an another (next one) char. but switch satatement working just for once. how can i repair this? : // this code should take every char and see if its 'A' or 'T'. Then if it takes an'A' it should ignore the next 'A'characters until it takes an 'T'. it kinda like matching the 'A' and 'T' like a dna chain.


#include <stdio.h>

int main(){
	
	int a=0,t=0,i=0;           //definitions
	char c;
	
	c = getchar();
	
	while (i<25){          //only the first 25 characters will be processed.
		
	switch (c){
		
		case 'A': a++; 
		break;
		case 'T': t++;
		break;
		
	}	
	
		if (a>t+1){
			
			c = c - 'A';
			
			a--;

		}
		
		if (t>a+1){
			
			c = c - 'T';
			
			t--;
			
		} 
		
		i++;
	
	}
	
putchar(c);	
	
	return 0;
}