Questions tagged as 'c'

1
answer

Union of vectors in the C language

Question: Make a program that reads two vectors of 10 elements. Create a vector that is the union between the 2 previous vectors, that is, that contains the numbers of the two vectors. It should not contain repeated numbers. #include <stdio...
asked by 13.11.2018 / 02:34
2
answers

I can not make it appear how many students have been approved

Algorithm to read 2 notes of a student, calculate and print the final average. Right after writing the message "Calculate the average of another student 1.Yes 2.No?" and request a response. If the answer is 1, the algorithm must be run again, o...
asked by 08.11.2018 / 00:31
1
answer

Read char array from a binary file

Function that writes and reads the binary file: int FUNCAO_QUE_GRAVA_BIN (char filename[],int partida1,char resultado1) { typedef struct { int partida; char jogvelha[3][3]; char resultad...
asked by 27.11.2018 / 12:20
1
answer

Problem with the calculation of the average in C language

I'm doing this exercise:    4 - Write an algorithm that reads a set of 50 tokens each   containing the height and sex of a person (1 = male and 2 =   feminine), and calculate and print:       The highest and lowest height of the class;  ...
asked by 26.10.2018 / 19:26
1
answer

Change number of digits after the comma depending on the situation [duplicate]

I know I can get a digit bound after the comma with %.2f to float and %.2lf to double . How can I change this limit depending on the occasion? For example: Get a two-digit limit with float that would...
asked by 09.07.2017 / 03:54
1
answer

warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] [closed]

#include <stdio.h> #include <stdlib.h> #include <strings.h> int main() { int j, vogais = 0, VOGAIS = 0, vogaistotais, tam; char a[1] = "a"; char e[1] = "e"; char i[1] = "i"; char o[1] = "o"; char u[1] = "...
asked by 30.10.2018 / 04:58
2
answers

How to put an integer at the end of a string?

I need to loop through n by putting an integer at the end of a string. Ex: string "E0" and an integer from 0 to n , something like this:    E00, E02, E03, ..., E0n char ent[3] = {'E','0'}; char a[1]; int n=5;//exempl...
asked by 18.11.2018 / 23:44
1
answer

Targeting failure in C language

Hi, I have a problem ... The code only runs to a part after this appears: Falha de segmentação (imagem do núcleo gravada) Here's my program below: #include<stdio.h> #include<stdlib.h> #include<string.h> int seleciona_in...
asked by 13.11.2018 / 20:16
1
answer

Infinite Loop in Height Growth Analysis

Gustavo has 1.40 meters and grows G centimeters per year, while Juliano has 1.10 and grows by centimeters per year. My program is giving an infinite loop when I execute. #include<stdio.h> int main() { float g,j,gus=1.40,jul=1.10; i...
asked by 15.09.2018 / 01:10
1
answer

How do I display the highest height ever read on the screen?

int sexo = 1; float altura; int tm = 0, tf = 0, sm = 0, sf =0; printf ("O valor 0 encera o programa !!!\n"); while (sexo!=0) { printf ("1-Masculino\t2-Feminino\n"); scanf ("%d", &sexo); if (sexo == 1)...
asked by 06.12.2018 / 23:27