Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. int main()
  5. {
  6.     int first, last;
  7.     int product = 1;
  8.     printf("Program oblicza iloczyn wszystkich liczb nieparzystych calkowitych z przedzialu domknietego podanego przez uzytkownika \n\n Podaj granice przedzialu: ");
  9.     scanf_s("%d %d", &first, &last);
  10.     for (product = first; first <= last; first++, product = product * ((first*(first % 2)) | 1));
  11.     printf("Iloczyn jest rowny: %d", product);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement