Mam problem z kodem który w sumie działa poprawnie ale w konsoli, po poprawnym wyniku, pojawia się zbędna liczba całkowita. Dlaczego tak jest?
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int dodac(int d, int e);
int odjac(int d, int e);
int pomnozyc(int d, int e);
int podzielic(int d, int e);
int main()
{
int a = 0;
int b = 0;
printf("\nWpisz A\n");
scanf("%d", &a);
printf("\nWpisz B\n");
scanf("%d", &b);
printf("\nWynik dodawania:\n");
printf("%d", dodac(a, b));
printf("\n");
printf("\nWynik odejmowania:\n");
printf("%d", odjac(a, b));
printf("\n");
printf("\nWynik mnozenia:\n");
printf("%d", pomnozyc(a, b));
printf("\n");
printf("\nWynik dzielenia:\n");
printf("%d", podzielic(a, b));
printf("\n");
}
int dodac(int d, int e) {
int c;
c = d + e;
return (printf("%d\n", c));
}
int odjac(int d, int e) {
int c;
c = d - e;
return (printf("%d\n", c));
}
int pomnozyc(int d, int e) {
int c;
c = d * e;
return (printf("%d\n", c));
}
int podzielic(int d, int e) {
int c;
c = d / e;
return (printf("%d\n", c));
}
created
last reply
- 3
replies
- 437
views
- 3
users