Posts by riekes • 11 points
2 posts
-
0
votes3
answers59
viewsA: What am I doing wrong? (struct)
You don’t need the word struct in the variable declaration. #include <stdio.h> int main(){ struct book{ char code[5]; char title[30]; char category[15]; char author[30]; float price; }; book…
-
1
votes2
answers5055
viewsA: Largest/Minor/Sum in C++ using for
#include <iostream> using namespace std; int main(){ int n, i, h, l, s = 0; // Inicializar a soma "s" em zero cout << "Digite 5 números:\n"; for(i=0; i<5; i++){ cin >> n; s+=n;…