Questions tagged as 'c'

1
answer

Complicated program [closed]

I'm already trying to make a program that does the following: Ask a user to type a number of numbers and then to enter the number of numbers that he wants to have in the combination and then the program prints the combinations and the quantities...
asked by 15.05.2016 / 19:49
1
answer

Evaluate game-of-the-old code [closed]

I've been programming for a while and would like you to rate my code in C. It's an old game using a circular data structure. My code is here : #include <stdio.h> #include <stdlib.h> #include <math.h> /* * row...
asked by 21.03.2018 / 04:27
1
answer

Processes - Doubt

To better understand how processes work, fork, I wrote this test program: #include <unistd.h> #include <stdio.h> int main(){ int value = 9 ; int pid = fork(); if(pid==0) value+=2 ; else value-=5 ; printf("%d...
asked by 14.04.2016 / 03:50
1
answer

What's wrong with this stretch? file reading

What's wrong with this stretch ?? I need to open a file to read and store in a struct, but if I put the condition in while feof! = 0 , when I run it does not work. (this is a function being called in main) #include <stdio.h> #include &l...
asked by 23.12.2018 / 22:08
4
answers

Language exercise C [closed]

Create a program that reads six integer values from the keyboard, and then displays values read in the reverse order on the screen. Inverse order would not be from the smallest to the smallest. How to do? #include <stdio.h> #include <...
asked by 23.07.2015 / 02:39
2
answers

Help writing code [closed]

How do I use Dev-c ++ with this code. How to translate it to C? I started programming recently, I'm kind of wrapped up to understand some things. Programa CalculoMedia Var N1, N2, MEDIA: Real Início Leia N1 Leia N2 MEDIA ← (N1+N2)/2...
asked by 03.04.2014 / 16:11
1
answer

id returned 1 exit status C code, help

My code is giving error id returned 1 and I have not the slightest idea why this is giving this error I did everything right, could anyone help me? #include <stdio.h> #include <stdlib.h> int main () { float CP,LP,PP,LA...
asked by 27.04.2014 / 20:30
1
answer

Is there any more beautiful way for me to change indexes? [closed]

Here's my code: #include <stdio.h> #include <stdlib.h> #include <locale.h> #include <unistd.h> #define tam 20 int main (void){ setlocale(LC_CTYPE, ""); int num[tam]; int troca[tam]; for(int i = 0; i <...
asked by 30.06.2017 / 21:35
2
answers

How to show the number that most appears in a vector in the C language?

Given a sequence of N numbers between 0 and 100. Determine which is the highest frequency value. Here's what I've done so far: #include <stdio.h> #define max 100 int main() { int vetor[max],i,j,frequencia=0,maior=0,tamanho_veto...
asked by 25.05.2018 / 20:00
1
answer

Vectors, pointers, and storage in memory [closed]

I need to solve an exercise where I need to use pointers, vectors and memory storage:    Create a vector with n elements, where each vector position   will match a pointer to a value of type float . Do it   read n values and store them...
asked by 21.12.2015 / 16:24