Laço FOR em C (loop)

Exemplo do laço for em C

#include <stdio.h>

int main()
{
	int x,y;
	for (x=0,y=0;x+y<10;++x)
	{
		y=getchar();
		y=y-'0';//subtrai o cod ASCCI do caractere 0 de y
		printf("%d = X  e %d = Y\n",x,y);
	}
	return 0;
}
Compartilhar:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • RSS
  • Twitter
  • Add to favorites
  • Diigo
  • email
  • LinkedIn
  • Live
  • Mixx
  • MySpace
  • PDF
  • Sphinn
  • StumbleUpon
  • Yahoo! Bookmarks

Tags:

Leave a Reply