Questions tagged as 'c'

2
answers

Sum of even numbers and multiplication of odd numbers in a range

   Read two numbers where y is greater than x, calculate the sum of the numbers   pairs of this range of numbers, including the numbers entered;   calculate and show the multiplication of the odd numbers of this   range, including those typed;...
asked by 06.07.2017 / 23:42
1
answer

Inequality in C language

Data: Brutus is 1.84m and weighs 122kg and Olivia is 1.76m and weighs 45kg. IMC = peso/(altura*altura); IMC: 18,5 a 25 -----> Saudável I want to create an algorithm that prints the MINIMUM amount of pounds that Brutus and Olivia must...
asked by 24.08.2017 / 17:55
2
answers

How to read data from a file in c and treat it as a string?

How to read data from a file in c and assign it to a string? file.c #include <stdio.h> #include <stdlib.h> #include <string.h> #define CONFIG "config.ini" void main() { char *data, *data1, *stream; FILE* arquivo;...
asked by 27.09.2017 / 22:18
2
answers

Chance of possibility in c, c ++ or matlab

I need a program that gives me the possibilities of the following equation: x*y = 1700/57 Since x and y are real positives resulting from two integers ("a" and "b") different from 1 to 300 . I tried but...
asked by 04.10.2017 / 02:56
2
answers

How to test the factorial in Main ()?

How would main() of this function be? The user types a number and the factorial of the number appears on the screen. int fatorial(int num) { if (num >= 0) { int fat = 1; while (num > 0) { fat *= num; num--;...
asked by 21.02.2017 / 14:58
1
answer

How to represent complex numbers in C?

How to represent a complex number z = x + yi?     
asked by 04.10.2016 / 02:35
2
answers

Chained List - remove function

I'm programming a headless threaded list, in this program there is a remove function that aims to delete all repeated integers in a list, px: by taking the values 8 2 8 3 8 the function has to return 2 3, however this function apparently looped...
asked by 27.10.2016 / 15:09
2
answers

Invert array (positions)

I am trying to make an inversion of an array in the C language. For example: I have an array [1, 2, 3] , I need to invert the numbers in the SAME array, giving an output like this: [3,2,1] . I'm trying, but on reaching the...
asked by 07.12.2016 / 20:09
2
answers

C: Error in srand (time (NULL));

I'm doing a little game in C (college project) and am encountering an error in main, it follows: int main () { int x, y, i, j, linha, cnt=1, jl=0, jc=0, jogada_a=0, jogada_b=0; char coluna, jogador; srand(time(NULL)); x = (rand...
asked by 11.10.2017 / 18:47
1
answer

Duvida typedef void * [duplicate]

I'm seeing the following expression: typedef void* type_t; So I was doing tests and I put type_t in sizeof and it returned me 4 bytes in size more like that?     
asked by 23.12.2015 / 22:10