Questions tagged as 'c'

2
answers

Problem to remove space after line break

#include <stdio.h> int main (){ int x,y,i; scanf("%d",&x); scanf("%d",&y); if ((x<y)&&(x>1)&&(x<20)&&(y<10000)){ for (i=1;i<=x;i++){ printf("%d ",i);...
asked by 24.01.2018 / 21:46
1
answer

anyone know why this error?

When I try to enter any value character the skip program in the option and I do not even have the chance to write somebody knows why? #include <stdlib.h> #include <stdio.h> #include <string.h> #include <cty...
asked by 08.02.2018 / 23:31
1
answer

List chained in C - Reversing the nodes recursively

I'm following Paulo Feofiloff's Algorithm Projects notes, and I'm with difficulties in resolving a question from the Chained Lists chapter, transcribed below:    Exercises 5       Write a function that reverses the order of cells in a l...
asked by 09.01.2018 / 01:11
1
answer

How to check if the array is symmetric?

I'm doing a college activity in which it asks to check if the array entered by the user is symmetric or not. Here's my code: #define TAMANHO 4 #include <stdio.h> #include <stdlib.h> #include <locale.h> void receberMa...
asked by 08.01.2018 / 21:20
1
answer

C program that reads a text file and prints the lines in reverse order

I would like to know why running the script below, lines appear spaced, except the first line. Input Linha1 Linha2 Linha3 Linha4 Expected output Produtos: - Linha3 - Linha4 - Linha2 - Linha1 Output Obtained Produtos: - Lin...
asked by 09.01.2018 / 16:12
2
answers

Read an integer value from a file

I'm reading a file with the following lines: ADD 50 ADD 30 ADD 10 ADD 12 And I wanted to read only integer values for a vector. I'm using this code: while(EOF) { aux=(char*)malloc(1000*sizeof(char)); if(aux==NULL){...
asked by 10.01.2018 / 00:26
1
answer

How to know how to count repeated numbers in a vector?

I'm wondering if there are any repeated values in the array. Here is the code I tried, but I did not succeed. #include <stdio.h> int main(int argc, char** argv) { int a, i, j, c = 0; scanf("%d", &a); int vetor[a]; for(i =...
asked by 29.01.2018 / 16:28
1
answer

Doubt searching for sub string, inside a string

I've done everything the question asked but I'm taking 70% error. Issue Link My code #include <stdio.h> #include <string.h> #include <ctype.h> int main(int argc, char** argv) { char nome[10000], zelda[6] = "zelda",...
asked by 03.02.2018 / 23:37
2
answers

Vector size in C

I'm new to the C language and am having trouble determining the size of struct-type vectors. Example. I have a category-type structure with three types of variables 1 int and 2 char. #include <stdio.h> #include <stdlib.h> stru...
asked by 04.02.2018 / 03:32
2
answers

Strings and Arrays, problems getting the right result

The purpose of the program is to display information in one option and a 10-question inquiry in another option. Each discipline has 10 questions, and each discipline is done in a subprogram. the problem is the use of the string. typedef struct...
asked by 21.01.2018 / 19:06