I need to create an algorithm that converts decimal to octal, but my conversion is wrong, can anyone help me how would it be right?
#include <stdio.h>
int decim(int n)
{
int i,a;
int octal;
if(n<=7)...
I need to make an algorithm that the user informs two values and return the largest between them using double, but at the time of compiling it from the error pointing something in the double but I do not know how to solve, someone can help me an...
When I type the temperature in Fahrenheint the program returns 0 as a result, where is the error?
#include <cstdlib>
#include <iostream>
#include <conio.h>
#include <string.h>
#include <math.h>
using...
I have to understand this code that my advisor passed to me.
How much% of% after opt is required?
The command switch too? Why does not it appear after the options break and case '?' ?
if( argc <= 1) {
fp...
If I give a printf like this:
int x=5, *px = &x;
printf("%d %ld\n", x, (long)px);
Until then without Warning , but if you change the printf :
int x=5, *px = &x;
printf("%d %d\n", x, (int)px);
I get a warning:
...
I have a file In this format:
link (link to download the file read);
[105][32][55][10][32][32][32][32][32][32][32][32][32][32][32][32][32][32][32][32][32][82][101][108][101][97][115][101]...
I need to read the data in this format:
10...
I have alloted this struct by dynamic allocation and can only access the data idade via arrow and not by point wanted to know why?
#include<stdio.h>
#include <stdlib.h>
struct pessoa
{
int idade;
};
void alteraId...
I wonder why the last printf of my program is always the same? I made it in C and I'm a beginner. The purpose of the program is to verify that a
is palindrome or not. But when it comes time to print the result, in every run of the program...
I have the following code:
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
int main() {
char v[]= {'Brasil', 'Alemanha', Japão'};
int i = 0;
for (i=0; i<4; i++){
printf("%s", v[i]);
}
}
Ho...
Good evening, I have a problem with the code I'm doing. I'm not sure if I'm deleting the values correctly (and replacing the next). The error is appearing in the substitution by the next and I do not know if I'm correctly passing the x, which is...