Questions tagged as 'c'

2
answers

What code to print only the first number of a value? ex: only 8 of 8372883

#include <stdio.h> int main(){ int a, b, c, d; printf("Insira um numero de quatro digitos: "); scanf("%i",&a); b=a%10; c=a%100; d=a%1000; printf("%i\n%i\n%i\n%i",a,d,c,b); return 0; }     
asked by 05.09.2018 / 10:33
3
answers

Returning (Null) when displaying a variable String

The program should receive a person's name and gender and show the data entered by the user, but when the program shows the name I typed it is appearing Null instead of showing the name. #include <stdio.h> #include <stdlib.h> #inclu...
asked by 27.09.2018 / 16:54
1
answer

File copy error in C language [closed]

Hi! I'm trying to create a copy of a C file, but I'm not able to copy the content, it's just creating a new blank file, can anyone see where I'm going wrong? #include <stdio.h> int main() { char str[100]; FILE *file = fopen("/ho...
asked by 23.11.2014 / 15:37
2
answers

Problems in passing arguments by parameter

I'm having trouble passing arguments by parameter. The error occurs in line 23 column 5 and is as follows:    too few arguments to function 'imc' #include<stdio.h> #include<stdlib.h> #include<math.h> #include <unistd...
asked by 24.10.2014 / 16:03
1
answer

Subtleties between Python and C [closed]

Good evening! Sunday I discovered that I will have to learn python, that the subject that I will study will be in this language and can not escape. I studied well this week and managed to get to matrices, but I came across subtleties that I'm st...
asked by 10.08.2017 / 03:25
3
answers

How to put a whole word inside a char?

How do I put a word with letters and numbers inside a char? For example, put on the board of an ABC-1234 car. char a = ABC1234; char b = DFG0000; printf("1ª placa %s\n",a); printf("2ª placa %s\n",b); Give code error. How do I procee...
asked by 15.10.2017 / 23:36
2
answers

Error assigning variable value to vector in C

I am creating a user registry using struct . In it, there is the CPF field. As it is a very large field to save in numbers format, I decided to save as string, as well as in database where cpf is saved with varchar . I do a valida...
asked by 15.10.2017 / 00:06
1
answer

Change scenarios with loop

How do I create a loop in Processing that switches between three or more scenarios (summer, winter and fall) when my object (car) reaches the edge of the window?     
asked by 19.10.2017 / 00:13
2
answers

JavaScript and Language C accessing the same database

I'm using a Facebook APP (and JavaScript SDK) to use the login on a website, plus I should store some basic information about the user. By requirement of the teacher, this site was all built "using language C" (Mongoose). The problem is: I...
asked by 14.10.2015 / 15:29
1
answer

What's happening here in this C program?

I'm doing a program where the user enters 10 values, and at the end of it, displays a message saying the value total. My code: int rep,valor,soma; while(rep < 10) { printf("Digite um valor : "); scanf("%d",&valor);...
asked by 21.06.2017 / 04:11