Buscar

Programas

Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original

Programas/Exemplo1.c
/*Imprimir num. de 0 a 98 com incremento de 2*/ 
#include <stdio.h>
int main() {
	int x,y;
	printf("\n");
	for (x=0, y=0; x+y < 100; x=x+1, y=y+1)
		printf("%d ", x+y);
	printf("\n");
	return 0;
}
Programas/Exemplo1.exe
Programas/Exemplo2.c
#include <stdio.h>
int main() {
 char ch;
 for (ch='a'; ch < 'z'; ch++)
 printf("O valor ASCII de %c eh %d.\n", ch, ch);
	
	return 0;
}
Programas/Exemplo2.exe
Programas/Exemplo3.c
/*Lê um caractere e imprime o seguinte até que seja digitado X*/
#include <stdio.h>
int main() {
 char ch ='';
 for (ch=getchar(); ch != 'X'; ch=getchar())
 printf("%c",(ch+1));
	
	return 0;
}
Programas/Exemplo3.exe
Programas/Exemplo4.c
#include <stdio.h>
int main() {
 for (;;)
 printf("Loop infinito\n");
	
 return 0;
}
Programas/Exemplo4.exe
Programas/Exemplo5.c
#include <stdio.h>
int main() {
	char ch;
	while((ch = getchar()) != 'X')
		printf("%c\n", ch);
	
	return 0;
}
Programas/Exemplo5.exe
Programas/Exemplo6.c
#include <stdio.h>
int main() {
	int num;
	long resposta;
	while (1) {
		printf("Digite o numero: ");
		scanf("%d", &num);
		resposta = 1;
		while(num > 1)
			resposta *= num--;
		printf("O fatorial eh: %ld\n", resposta);
	}
	return 0;
}
Programas/Exemplo6.exe
Programas/Exemplo7.c
#include <stdio.h>
int main() {
	char ch;
	do {
	 printf("Digite um caractere:");
	 scanf(" %c", &ch);
	 if ((ch >= 'a') && (ch <= 'z'))
		 ch = ch + 32;
		 
	 printf("%c %d\n", ch, t);
	} while (ch != '=');
	return 0;
}
Programas/Exemplo7.exe

Teste o Premium para desbloquear

Aproveite todos os benefícios por 3 dias sem pagar! 😉
Já tem cadastro?

Continue navegando