Print letter in for loop - C Statement

C examples for Statement:for

Description

Print letter in for loop

Demo Code

#include <stdio.h>
void print_letter2(void);           /* function prototype */

char letter1 = 'X';
char letter2 = '=';

int main( void )
{
   for(int ctr = 0; ctr < 10; ctr++ )
   {//from w  w  w.  ja  v a  2 s.  c  o  m
      printf( "%c", letter1 );
      print_letter2();
   }
   return 0;
}

void print_letter2(void)
{
   for(int ctr = 0; ctr < 2; ctr++ )
      printf( "%c", letter2 );
}

Result


Related Tutorials