Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. /**********
  2. Name: Verwendung des double Datentyps ( pq Formel
  3. Inahlt: durch Eimgabe , werden erst p und danach q festgelegt,
  4. der Pc rechnet danach die Nullstellen der Funktion aus.
  5. ***********/
  6.  
  7. #include <math.h>
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10.  
  11. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  12.  
  13.  
  14. double p = 0.0;
  15. double q = 0.0;
  16. int main()
  17.  
  18. {
  19.  
  20.  
  21.  
  22. int ergebniseins;
  23. //double ergebniszwei;
  24.  
  25.  
  26. //int ergebnis;
  27.  
  28. scanf("%f", &p );
  29. scanf("%f", &q);
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. printf("Fuer 'P' wurde %i angegeben und fuer 'q' wurde %i angegeben ", p,q );
  37. ergebniseins = -(p/2 ) + sqrt(((p*p)/4)-q);
  38. // ergebniszwei = (-p/2) - sqrt((p*p/4-q);
  39. printf("\nNullstelle 1: %i ",ergebniseins);
  40.  
  41. //printf("ergebnis: %i", ergebnis) ;
  42.  
  43.  
  44.  
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement