Questions tagged as 'c'

1
answer

Game resolution Sudoku giving infinite loop in C

I have the following code in C : #include <iostream> #include <stdio.h> #include <stdlib.h> #include <time.h> // Variáveis globais int jogo_tabuleiro[9][9] = {0}; int func_quadrante(int quadrante, int numero) {...
asked by 20.06.2016 / 00:00
2
answers

How do I use% d or% c ... in the cout statement?

I am studying C and C ++ and would like to understand how I could transform this code written with printf() into cout , or how to use the %d %x %c , etc. functions. no cout . int main() { printf("i make...
asked by 02.08.2018 / 18:09
1
answer

Variable percentage in c [closed]

I have a problem with simple code, I want to know how to calculate the percentage of a value. EX: 1500 + 15% (in this case I know it's value = value * 0.15) But the percentage value must be a user-entered variable. So far I have the follow...
asked by 25.03.2018 / 04:14
2
answers

Correction error game

With this game that when the error in the beginning of the game he says that a letter was wrong, but if you hit a letter and then make a mistake, it does not count. Help me. Error: When I start the game, it asks for a word to be entered. If y...
asked by 11.06.2017 / 17:31
2
answers

C - Problems with printing [closed]

Hello! So I'm having trouble with the variables "day" and "time". Even though I make the necessary selection, the variable is not printed on the screen at the end of the program. I made several changes but none of them had any effect, so I ask f...
asked by 20.10.2017 / 01:45
1
answer

how do I solve this exercise in c / c ++

In the end I still have to figure out which stores are showing a price within the media, someone helps me; #include<bits/stdc++.h> struct difsites{ double preco; char loja[50]; char site[50]; }; int main(){ int i,j; d...
asked by 23.06.2018 / 03:56
1
answer

Wrong calculation

#include <stdio.h> #include <stdlib.h> float dobro_do_maior(float x, float y) { float dobro; if(x > y) { dobro = x * 2; }else{ dobro = y * 2; } return dobro; } void main() { float a, b...
asked by 25.11.2018 / 20:39
2
answers

scanf shows number always as pair

I have a problem and I do not know how to solve it because I'm starting to use Dev-C ++ now. I do not know much about it, the problem is the following I was able to solve a bug I was having, which was the use of % . Now I have another prob...
asked by 03.04.2014 / 19:46
1
answer

Code goes into infinite loop

Why is this code in loop infinity? #include <stdio.h> #include <stdlib.h> #include <conio.h> int main() { int i; float salario[10], valorDataBase, salarioReajustado[10]; printf("Informe o percentual de reajuste da data-...
asked by 22.11.2018 / 18:35
2
answers

Error to print on screen a name in C, using threaded list

I made this code with the purpose of asking for notes and names and then printing on the screen, so for some reason the name n is being shown the name that was entered. The code was made in C. { #include <stdio.h> #include <stdlib.h>...
asked by 23.05.2018 / 21:55