Questions tagged as 'c'

1
answer

Add the diagonals of an array

I need to make a program that adds diagonals to an array. According to the example ButI'mhavingalotoftrouble.Hereisthecode:#include<stdio.h>#include<math.h>#defineM4#defineN3intmain(){inti,j,soma=0;intmat[M][N]={{1,2,3},{4,5,6},{7,8...
asked by 20.04.2017 / 18:40
1
answer

Print circular list function

Personal I have a question of where and how should I change to this function to print circular list is correct. Below is a print function from a linked list: void imprime_lista(tipo_lista* p) { while (p != NULL) { printf("%d\n", p->i...
asked by 17.05.2017 / 21:11
1
answer

Function for matching points

In an exercise, I need to create a function that returns TRUE if the points are identical. For the points, a structure was implemented as follows: typedef struct //Estrutura definida para os pontos. { double x; //Coordenadas X e Y. dou...
asked by 26.06.2017 / 19:22
1
answer

Rename a String in a Vector of Structures [duplicate]

Good afternoon guys, I'm locking in a part of my code and I do not really know the logic to solve it. If the manufacturer name of the vector carros at position j is equal to Chevrolet , change it to GM . for(j =...
asked by 28.06.2017 / 21:06
2
answers

Calculation of the smallest divisible number giving infinite loop in C

I made a program in C to solve the following exercise: Code:#include"stdio.h" #include "stdlib.h" int main(int argc, char const *argv[]) { int num = 0; int count = 20; int contaDivisores = 0; for(int i = 1; i <= count; i++){ for(in...
asked by 20.04.2017 / 00:44
1
answer

Files crt * .o in C

What are the crt1.o,crt0.o,crti.o e crtn.o files in a C program? I know that the .o extension has to do with the object file, but what do the files cited serve?     
asked by 19.04.2017 / 16:50
1
answer

Evaluative activity hours per minute

   Question (2): Make a program that receives an hour consisting of hour and minutes (a real number), calculate and show the time entered in minutes. Consider that:       For four-thirty (4:30), enter 4.30;    For four and fifty (4:50), you m...
asked by 07.04.2017 / 17:03
1
answer

Would you like to add a parameter in: system ("color", var) in C language?

I'm creating a simple program to change the color of the system. Only, I want to give the user the option to write the color he wants. Ex: Has the table 1: Blue 2: Green F: Red C: Yellow Being F background color and 1 font color. Then looking...
asked by 02.04.2017 / 04:27
2
answers

If-else command is not working

In one of the exercises in a book I'm reading, I'm asked to trace a person's "profile" according to the year they were born (like those Facebook tests) but in order to limit the possibility of what is typed, I put a if to signal an error,...
asked by 05.04.2017 / 03:13
1
answer

password confirmation on c

I need to register N people in my program with only two information: name and password. After the user enters a name, if this name is not registered the program displays a non-registration message and closes, but if it is registered it asks the...
asked by 10.04.2017 / 05:36