Most voted "c" questions
C is a general-purpose computer programming language used for operating systems, games, and other high-performance jobs and is clearly distinct from C++. It was developed in 1972 by Dennis Ritchie for use with the UNIX operating system.
Learn more…4,811 questions
Sort by count of
-
-2
votes1
answer34
viewsMake a code that reads a text and shows without vowels. The code cannot use functions
#include<stdio.h> #include<conio.h> main() { char texto[41]; int n,i; printf("Entre com um texto\n"); gets(texto); for(n=0;texto[n]!='\0';n++); i=0; while(texto[i]!='\0') { if…
-
-2
votes1
answer26
viewsInterval between commands in C#
I am trying to create an interval between 2 commands. I want to show something on the screen for the user, wait a while and delete the text. I have researched several places and found nothing. I…
-
-2
votes0
answers34
viewsI need this code to generate the value 0 or 1, (not all the code is there)
I need this code generates the value 0 or 1, can anyone help? And if it is 1 need q write it rained and 0 did not rain #include <stdlib.h> #include <stdio.h> #include <time.h> {…
casked 3 years, 3 months ago Uzzoper Fortnite 1 -
-2
votes0
answers17
viewsShow the average number typed in C
Display the average number typed by the program user. the Restrictions The program captures the values typed by the user until the number typed to zero; when zero is typed, the program terminates…
-
-2
votes0
answers12
viewsCryptography in C language
I need to make a pseudo-code to then pass in C-language from a Hill cipher encryption. The phrase to be encrypted will be inserted by the user and the key matrix as well. I cannot use character…
-
-2
votes0
answers20
viewsHow to write a code in C language without arithmetic operators and without if/switch?
I need to write a code in C that indicates whether the integer is even or odd. The program has to show 0 when it is even and 1 when it is odd. However, the teacher placed the restrictions described…
-
-2
votes1
answer71
viewsResolve Operation with Set
Question 1 - Consider the set X = {x Z : 1 x 32}. Implement a program in C that performs the following instructions. Create three integer-type vectors of size 12: vector 0[12], vector 1[12] and…
-
-2
votes1
answer66
viewsSome test that this code does not pass
I’m asking the question Voice Dial, I’ve done every test possible and can’t find the error could help me in other test that my code fails My code #include <stdio.h> #include <string.h>…
-
-2
votes1
answer62
viewsHow do I if the user type a number other than 1 and 2 he asks you to terminate the program? n[1] for yes and [2] for no
How do I if the user type a number other than 1 and 2 he asks you to terminate the program? n[1] for yes and [2] for no #include <stdio.h> #include <stdlib.h> int main() { int N1, N2, Q,…
-
-2
votes2
answers108
viewsConvert add and remove functions in tree to recursive
I’m having trouble converting two tree functions into C recursive form. int insere_arvore(ArvBin* raiz, int valor){ if(raiz == NULL) return 0; NO* novo; novo = (NO*) malloc(sizeof(NO)); if(novo ==…
-
-2
votes1
answer107
viewsGet size of a two-dimensional matrix
I have a dynamically allocated two-dimensional char matrix, as I do to get its size? would use sizeof(client); for example, I instated a client struct, Client **client; then in the code I’ll…
-
-2
votes2
answers302
viewsWhen I run the commands on Switch Case, does it end instead of going back to Menu?
int main(){ int tensao, corrente, resistencia, potencia, tempo, cargaeletrica, trabalho, i; printf("\nPara calculo de Tensao(resistencia*corrente) digite 1\n\nPara calculo de…
-
-2
votes1
answer185
viewsProblems with Two-Dimensional String Matrix
My objective in this exercise is that in each loop to make a new snack order, the informed data be added in the final table (matrix[i][j]). In the second "for" is where I try to assign the variables…
-
-2
votes1
answer80
viewsCan anyone help me fix problem?
Action Receive two integers from the user, the first being the digit you want to know how many times it appears and the second being the contact number. In and out Entree: Integer value A (between 1…
casked 6 years, 2 months ago Debora Rute 17 -
-2
votes1
answer604
viewsSeparate a single string in an array of strings
In this code I am trying to make a string read and then put each word separated by space in an array of strings. I saw that in some cases the Strtok function is used, but since I intend to use these…
-
-2
votes3
answers491
viewsConverting C to Java
Consider a method that takes 2 parameters and makes a calculation to generate a check digit. Follow the code snippet I’m having difficulty: char metodoDigito(char num, char qtos) { short soma, peso,…
-
-2
votes1
answer70
viewsLoop of repetition for
My code is only printing the last case. Could someone help me? My Code... include<stdio.h> int main(){ int teste,total,i; float…
casked 6 years, 2 months ago Gabriel telemont 3 -
-2
votes1
answer736
viewsRender and display the Matrix in C (dev c++)
I have to do this: Make a program that loads a 12x4 matrix with the values of sales of a store, where each row represents one month of the year and each column represents a week of the month.…
-
-2
votes1
answer156
viewsprintf being duplicated after the first loop
I have this program and in the first loop of while it runs normally, print one single time each thing, but in the second loop it printa "Type S to vote, N to see the vote count and exit." twice…
casked 6 years, 1 month ago davi michetti 1 -
-2
votes1
answer226
viewsProblem with strcpy
I’m trying to fill in the fields of a struct with strcpy but I’m not getting the expected value, as for example: #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include…
-
-2
votes1
answer45
viewsError when executing the program hangs. Circular list(Solved) However I’m still in doubt
I have an error that only appears during the execution of the program. I would like someone who has knowledge of why this occurs, can explain to me. #include<stdio.h> #include<stdlib.h>…
-
-2
votes1
answer64
viewsCheck for repeated number and delete
Enter the data in VET, and then check the repeated numbers, and leave in VET1 only the numbers that are not repeated, but I’m not able to do this last part at all, follow the code I’ve done so far:…
-
-2
votes1
answer47
viewscomes out of the test alone
when I type the second option it goes only until the brand of the car does not enter the year and does not give any compilation error what can be #include<stdio.h> #include<stdlib.h>…
casked 6 years ago Jhonatan Pereira 1 -
-2
votes2
answers46
viewsHow do I print the smallest height ever read?
int sexo = 1; float maior=0,menor=0,altura; int tm = 0, tf = 0, sm = 0, sf =0; printf ("O valor 0 encera o programa !!!\n"); while (sexo!=0){ printf…
-
-2
votes1
answer40
viewsRecursive binary search, but this error appears:"expected Primary-Expression before 'int'"
#include <stdio.h> #include <stdlib.h> //Funcao para busca binaria com recursividade int BuscaBinariaR(int vetor[10], int inicio,int fim, int x) { int meio = (inicio+fim)/2;…
-
-2
votes1
answer54
viewsApplication for marking point!
Good afternoon guys, all right? I’m looking to develop an application here for work. Today where I work, we have corporate employees (they are among all the units of the company). And at the end of…
-
-2
votes1
answer55
viewsWhy are you printing strange character at the end of the palindrome evaluation?
#include <stdio.h> #include <string.h> #include <ctype.h> int main() { char frase[200], vetor_frase[200], palindromo[200]; int j = strlen(frase), x = 0, p =0; printf("Digite uma…
casked 5 years, 9 months ago Wellington Felix 26 -
-2
votes1
answer162
viewsPrograma pula scanf
My program skips the third Scanf, I’ve tried several ways to make it work but I couldn’t, it seems to be some memory allocation problem, but I’m not sure, someone could help me? #include…
casked 5 years, 9 months ago Marlon Vinícius Buosi 3 -
-2
votes1
answer31
viewsError saving a File to an Array
Apparently it follows everything right in the recording inside the while, I put a printf to test, but after the loop, I did not print the vector items anymore, and I could not find the error:…
-
-2
votes3
answers1158
viewsEven-odd vector fill C
Good people are caught in a little problem here I will put the statement here: "In this problem you should read 15 values put them in 2 vectors as these values are even or odd. However, the size of…
-
-2
votes1
answer106
viewsHelp me with this while and switch code in C?
Well I did this code in college, where it receives two integers and as the User chooses it performs an arithmetic operation with these two numbers typed. I believe my logic is correct, it compiles…
-
-2
votes1
answer150
viewsImplement a C program that displays the AMOUNT of prime numbers present in a vector, using dynamic vector allocation
I’m putting together a little program that aims to count how many prime numbers are present in a vector and tell the user the amount. In this case, if the vector has 5 primes, the program must print…
-
-2
votes2
answers63
viewsData entry being skipped after algorithm build
My code is quite simple and its functionality is as follows:: to) Request name of User b) Request age of User c) Display the same However, after the algorithm is compiled and run, when entering with…
-
-2
votes1
answer96
viewsHow to optimize the time of this code?
I created the code below to solve the problem Vault, of the 2017 OBI. It works, but in 60% of cases it exceeds the time limit, as I do to optimize it? #include <iostream> #include…
-
-2
votes2
answers55
viewsExercise to sequence numbers with Struct
I’m doing an exercise to sequence numbers using a struct, but what’s happening is that in my for the variable i is being incremented in a very strange way, in the second passage of scanf, its value…
-
-2
votes1
answer32
viewsHow to recover the address of the function that loaded my dll or the PE of the thread where it was loaded
The thread that loads my DLL uses Loadlibrarya , I would like to recover the address (01145EA7) from the instruction that loads it or the PE (01C5B514) from the thread that loads it. load dll assm:…
casked 5 years, 4 months ago Victor Costa 1 -
-2
votes1
answer32
viewsProgram to show the amount of uppercase shows only the amount of lowercase
I wrote a code to receive a char arrangement and return the amount of uppercase letters, but it’s doing the opposite ( returning the amount of lowercase ) and I don’t know why. void Questao4 () {…
-
-2
votes2
answers47
viewsMembers of a structure as pointers
In the code below I am trying to define a structure whose members are pointers that will be used to work with the name, email and age data, all dynamically allocated, of an employee. However, the…
-
-2
votes1
answer59
viewsPointer accessed improper data
I’m having difficulty implementing the logic of introducing new employees in the code below. When determining the new quantity and reallocating the vector based on it, the first new employee is…
-
-2
votes1
answer342
viewsHow do I print the data into a dynamically double-chained list in C?
Good afternoon, folks. This is my first question here on the site, so suggestions are welcome. I’m writing a code using Doubly Chained Dynamic List for the college’s Data Structure class and I’m…
-
-2
votes1
answer109
viewsHow to separate a string from a file that contains a sequence of chess rounds?
I need to read a file that will be encoded as the example: 1.e4 e6 2.Nf3 d5 3.Nc3 Nf6 4.e5 Nfd7 5.d4 b6 6.Bd3 Ba6 7.O-O Be7 8.Ne2 Bxd3 9.Qxd3 c5 10.c4 Nc6 11.cxd5 Nb4 12.Qe4 Nxd5 13.Qg4 Kf8 14.Nf4…
-
-2
votes1
answer42
viewsC program working but not continuing, gives error at the end
This is a program that I’ve been doing for presentation only that part of it is making mistakes that I haven’t been able to solve. Here is the . h: #ifndef PROJETOIAPG_PROJETO_H #define…
-
-2
votes1
answer144
viewsC - Array of indeterminate size
How to print x | fi correctly? If the user informs... 0 2 1 2 3 1 2 2 3 4 He should order so... 0 1 1 2 2 2 3 3 4 And print... X | fi 0 | 1 1 | 2 2 | 4 3 | 2 4 | 1 That is to say: 0 appears 1 time 1…
casked 4 years, 11 months ago Exponecial 1 -
-2
votes2
answers78
viewsDoubt [MEDIA PROBLEM]
Make a C program that receives a sequence of natural numbers and displays all elements which are greater than the arithmetic mean of this sequence. If there are no elements greater than the average,…
-
-2
votes2
answers184
viewsI’m having an error in my C program
I am having the following error in row 13 column 39: [Error] invalid conversion from 'char' to 'char*' [-fpermissive] It’s for a college job, I can’t fix the mistake in any way, someone knows what…
-
-2
votes1
answer59
viewsCan you improve my code?
Hi, I’m Vitor, and I’m new to programming and Stack Overflow, and I’d like some tips on how to clean my code. ->Code to read 50 integers between 0 and 9 and count how many times each number was…
-
-2
votes1
answer442
viewsHow to calculate fourth root in C
Hello, I’m a beginner in the programming area and I’m doing a program that calculates some types of averages, but in the geometric average the formula uses root quarter of a.b.c.d, I thought to use…
casked 4 years, 8 months ago Luis Artur 13 -
-2
votes1
answer33
viewsString changing previous list names (Struct + String + Function)
Good afternoon, I was giving a study in lists and I went to do a little programming but I can’t at all pass my string in the correct way to the function so that it doesn’t change all my previous…
casked 4 years, 7 months ago Victor Lopes 1 -
-2
votes1
answer312
viewsDisplay imaginary vector values with pointer arithmetic
Good afternoon ! I’m doing the following exercise ! -Create a program that contains an integer array containing 5 elements. Using pointer arithmetic only, read this keyboard array and print double…
-
-2
votes1
answer267
viewsLanguage C: How to store information in WHILE and present the entered data in a list?
I would like to know how do I save the data and present it at the end; I have not yet been taught to do so. How do I resolve item C of the question Consider that, for each of the farm hotels of the…
casked 4 years, 7 months ago Leonardo Pinto Silva 5