The code below when executed returns the result for m = 0 , but doing the table test the result should be -2 .
I can not prove 0 as a result unless the variable t++ when in (t * t++) , only this moment and only...
Consider a number system that does not have the addition operation
implemented and that you have only the operators (functions)
successor and predecessor. Then one is asked to write a function
recursive that computes the sum of two numbers x and...
I'm having trouble converting two tree functions in C to the recursive form.
int insere_arvore(ArvBin* raiz, int valor){
if(raiz == NULL)
return 0;
NO* novo;
novo = (NO*) malloc(sizeof(NO));
if(novo == NULL)
return 0;
novo->info = v...
I'm trying to make a C program to generate a diamond as exemplified in the image below:
I have not been able to come up with an algorithm that generates the required characters and spaces on each line.
What would be a reasonable way to...
#include<stdio.h>
int main(){
//Escolhe entre nome do personagem e classe
int p,c;
printf("RPG teste\n");
printf("Digite um nome para o seu(a) personagem:");
scanf("%s",&p);
printf("Escolha uma classe, digi...
I have this exercise on C to calculate the distance between two points using structs , but it repeats much the point code, for x and y , like doing on less lines or using array ?
#include <stdio.h>
#include <stdlib...
I would like to turn this into C code I have already done everything I just have the problem in the part "If MEDIA >=6 and FALTAS <=10 Then" mainly in the part of And I do not know how I will separate the account.
Programa C...
This code does not have any errors, however the program does not solve the game (it does not print answers on the screen):
#include<stdio.h>
#include<stdlib.h>
#include <time.h>
#define N 9
#define D 4
void facil(void);
voi...