c - Printing certain arrays -


Trying to print and count a certain array from my table. I want to print 'O' and it Count how many times this pops up, I got the counting part, but I stretched to print 'o' in a table format. Every time I try to print 'o' which gives me happy faces Are there.

  four posts [] = {'A', 'P', 'A', 'P', 'A', 'O', 'P', 'P', 'O '}; Count {if (poste [i] == 'O') for I (i = 0; i  

execute me (i = 0; i ; 9; i ++) Gives these happy faces

  Number of post APAPOppo operators: 2 poste ☺ ☺  

You are printing poste [i] == 'O' . You want to do the following:

 For  ( I = 0; i & lt; 9; i ++) if (poste [i] == 'O') printf ("% c", post [i]);  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -