Pular para o conteúdo principal

Postagens

Mostrando postagens com o rótulo long

C++, short, long, cont, incremento ++

#include void main() { short s; long l; for(s=0;s printf("%i\t",s); printf("\nPress Enter\n"); getchar(); for(l=0;l printf("%li\t",l); system("pause"); }

C, countdown, int, long, void, loop, start

/countdown  //codefree.mxatec.com #include void main() { int start; long delay; /* This loop ensures they type in the proper value */ do { printf("Please enter the number to start\n"); printf("the countdown (1 to 1000):"); scanf("%i",&start); } while(start 1000); /* The countdown loop */ //Example of a "nested loop" do { printf("T-minus %i\n",start); start--; for(delay=0;delay //delay loop } while(start>0); printf("Zero!\nBlast off!\n"); system("pause"); }

Fatorial recursivo, Unsigned, long, if((n==1)

#include #include using namespace std; unsigned long fatorial_recursivo (int n){ unsigned long resposta; if ((n == 1) || (n == 0))return(1); resposta = n * fatorial_recursivo(n - 1); return(resposta); } int main() { unsigned long f; int n; cout<<"Digite um número: \n"; cin >> n; f = fatorial_recursivo(n); cout<<"O fatorial de "< system("PAUSE > null"); return 0; }