Tag: c

shape
shape
shape
shape
shape
shape
shape
shape
Standard

Fibonacci Sequence – C/C++ Algorithm

The Fibonacci sequence is given in the following order [latex] Fibonacci = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 . . .[/latex]. The algorithm for calculating the nth element is given by: [latex] N = N – 1 + N – 2 [/latex], i.e. the nth element is equal to the

Standard

Calculating Factorials in C

Simple C program that calculates the factorial of any number: #include int main() { int fat, n; printf(“Enter a value for which you want to calculate your factorial: “); scanf(“%d”, &n); for(fat = 1; n > 1; n = n – 1) fat = fat * n; printf(“\nFactorial calculated: %d”, fat); return 0; } How

Standard

Conditional If and Else in C

In C, a true expression is an expression that equals or returns any value other than 0 and a false expression equals or returns 0. The general form of the If and Else sentence is: if(condição) // Se a condição for verdadeira expressão; // Execute isso. else // Caso o contrário expressão; // Execute isso.

Standard

Valid CPF generator in C/C++ with Source

Simple CPF generator in C/C++. created by me with source code and download below: Download: CPF Generator Source code: #include ; #include ; #include ; using namespace std; int main() { int vet[11], n, vet_v1[] = {10, 9, 8, 7, 6, 5, 4, 3, 2}, vet_v2[] = {11, 10, 9, 8, 7, 6, 5, 4,

Latest news

Latest news directly from our blog.