0
I am programming in C/C++ and gave an error that I cannot identify it.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
//Função Principal do Programa
int main() {
//Definindo variáveis
int a = 5, b = 10, c = 15;
//Maior
if(a > 2){
printf("\n %d Eh maior que 2\n", a);
}
//Maior ou Igual
if(c >= b){
printf("\n %d Eh maior ou igual a %d\n", c, b);
}
//Menor
if(a < 10){
printf("\n %d Eh menor que 10\n", a);
}
//Menor ou Igual
if(a <= 10){
printf("\n %d eh menor ou igual a 10\n", a);
}
//Diferente
if(c != 10){
printf("\n %d nao eh 10\n", c);
}
if(d != 'a'){
printf("\n %c nao eh a", d);
}
//Pausa o Programa após executar
system("pause");
}
Not that it changes to this case, but you need to decide if you’re programming in C or C++, you can’t do both.
– Maniero
Really, but I’m taking the c and c++ fundamentals course so since I’m a beginner I don’t know if I’m programming in c or c++ (I think c++), I understand your answer, every day that passes my knowledge increases gradually, I’d rather you had a list of "commands" to know correctly declare a variable or something like kkkk. But thank you for your attention and your reply helped me a lot.
– dzarm
It should be the first thing that the course talks about. Besides, if the course says that it is amos, the course already has problems. There is no C++ line in this code, although Compile in C compiler++.
– Maniero
True, I agree with every word said above, and searching lists of commands I realized that even the language used is C. Now regarding the institution, it is not the best but I do Analysis and system development and I will have programming this semester, I just don’t know if I’ve found the best way. A e além de "adiantar" I’m adding knowledge to my resume because I need to work. Thanks for commenting man.
– dzarm
Adding knowledge is not a good way, it is better to learn and this is done in a structured way, with correct information, in order, on a previous basis. You can ask whatever you want here to learn, as long as you’re on time.
– Maniero
Thank you, I saw your profile and you teach courses?
– dzarm
No, but I’m thinking about it, the problem is that I think most people wouldn’t like my courses, people like the courses "cheat me that I like", I would do something well pulled, that goes deep, that teaches even, that tells the guy to go further, which shows that it is necessary to question and not just absorb, people do not like it very much. But guess who likes it a lot? The job market. But who makes the decision about what course to do is the person, market has no conscience. Of any adds me in some network, maybe something comes out.
– Maniero