+ 1
C
#include <stdio.h> #include <conio.h> void main() { int *p1, *p2, sum; clrscr(); printf("Enter two numbers: "); scanf("%d%d", &*p1, &*p2); sum= *p1 + *p2; printf("sum=%d", sum); getch(); return 0; } Pls my code it’s not bringing out the expected output What is wrong with it,.,someone help me out pls
11 odpowiedzi
+ 2
FF9900
<conio.h> header, void main() signature, clrscr() or getch() are all Turbo C/C++ stuffs, MS never admitted them in their standard.
+ 2
Remove all *
+ 1
FF9900 what is MS specific stuff and SL?
+ 1
FF9900 u took out the clscr and getch statements
that is what makes it a pointer i guess
i was told to work with them by instructor
+ 1
FF9900 will the answer still be the same with conio.h and clscr and getch
will it still output same result??
+ 1
G'day Ejeh Wayne you say you were told to use pointers, so best you learn a bit about them. I'm still learning, but there are many users here that are proficient.
Did you know, you can post SoloLearn "code bits" in the Q&A forum, it makes checking operation much easier for other commenters.