darius90

8.C összehasonlít

Dec 8th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int osszehasonlit (int i,int c) {
  5.    int a;
  6.    if (i==c)
  7.     a=1;
  8.    else a=0;
  9.  
  10.     return a;}
  11.  
  12.  
  13. int main()
  14. { int a=5;
  15.  int b=6;
  16.  int c;
  17.  c=osszehasonlit (a,b);
  18.     if (c==0)
  19.         printf ("a nem egyenlo b-vel");
  20.         else printf ("a=b");
  21.     return 0;}
Advertisement
Add Comment
Please, Sign In to add comment