Questions tagged as 'c'

3
answers

Compiler accusing error that I do not know

#include<stdio.h> int sumofDie(int value1, int value2); int main( void ){ int die1[7]; int die2[7]; int i; srand(time(NULL)); printf("Rolling die 1 ..........\n"); for( i = 0; i < 6; i++){ int value; value = 1 + rand() % 6;...
asked by 05.01.2017 / 04:50
2
answers

Error adding library using Linux

I'm just trying to compile examples from the book and get fatal error: No such file or directory when trying to include conio.h, io.h and curses .h . I read in the SOen and it was suggested just this < i> curses.h , which I get error....
asked by 12.01.2016 / 23:01
1
answer

Making Calculation of IMC I'm not only getting the result 80

#include <stdio.h> #include <math.h> int main() { float peso,altura,imc; imc=0; printf("digite seu peso ?"); scanf("%f",&peso); printf("digite sua altura? "); scanf("%f",&altura); imc= (peso...
asked by 16.09.2018 / 04:06
2
answers

How to implement this while not from Python in C?

I am studying a code in Python that I need to transform to C, but the part that is confusing me is this: while not(f1 == 0 and fn == 1): ... How would this same C code be?     
asked by 04.09.2018 / 22:34
3
answers

Pointer to char in printf () does not work

I decided to make this code simple, where I have an empty vector and a function that fills it only with a letter that the user types, but I can not print. If I use that commented% com, it works, but if I print out it does not come out of the...
asked by 26.07.2018 / 03:17
1
answer

What is the utility of the struct command in c?

I've already learned how to use the command in a code, but I still do not understand exactly what it's for. Could someone explain me, with examples if possible, its usefulness?     
asked by 24.08.2018 / 06:36
2
answers

Show only the last word of a string

The purpose of the program is to read a string , eg read - Silva printar That is, always start the last word of string . My logic was to read the string from back to front, and to find the first space to stop the loop. In t...
asked by 25.01.2018 / 19:17
1
answer

What is the difference between C and C99?

I saw C99 in text and I was curious is there any difference between normal C and C99?     
asked by 02.05.2018 / 21:04
3
answers

Doubt about recursion in C

I'm learning about recursion, using the C language, and I have to do the following exercise:    Design a recursive function that takes an integer n and computes the sum of the digits of n.       For example:       for n = 327 , the re...
asked by 27.03.2018 / 02:46
2
answers

Error in my C Program

When I type 0 it does not report as the program should: "Incorrect entry. Enter an integer value". #include <stdio.h> void LimpaBuffer(void) { int valorLido; /* valorLido deve ser int */ do { valorLido = getchar...
asked by 17.12.2014 / 14:19