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...
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...
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...
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;
...
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...
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...
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...
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...
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)...