Soluții

Cum inseram un shape in Libre Office Writer

Libre Office Writer, parte componenta a pachetului Libre Office este o alternativa free a Microsoft Office Word. Putem insera in documentul nostru diverse shape-uri: forme geometrice (dreptunghiuri, patrate, cuburi), simboluri, grafice, etc. Pentru exemplul de astazi vom insera un smiley face urias.

[mai mult...]

C++ Program to Add Complex Numbers by Passing Structure to a Function

In this program, two complex numbers entered by the user are stored in the structures num1 and num2.

  • These two structures are passed to addComplexNumbers() function which calculates the sum and returns the result to the main() function.
  • This result is stored in the structure complexSum.
  • Then, the sign of the imaginary part of the sum is determined and stored in the char variable signOfImag.
  • If the imaginary part of complexSum is positive, then signofimag is assigned the value '+'. Else, it is assigned the value '-'
  • We then adjust the value of complexSum.imag.
  • This code changes complexSum.imag to positive if it is found to be of negative value.
  • This is because if it is negative, then printing it along with signofimag will give us two negative signs in the output.
  • So, we change the value to positive to avoid sign repetition.
  • After this we finally display the sum.
[mai mult...]