+ 5
Remove getch from program and what is use of curses.h header file i seen this first time i have not removed this headerfile but your program woRkiNg fine. #include <stdio.h> #include <curses.h> int main() { int i, n, sum; printf("Enter a number :") ; scanf("%d", & n) ; sum=0; for(i=1;i<=n;i++){ sum=sum+i; } printf("\nThe sum is:%d", sum) ; //getch() ; }
20th Sep 2020, 4:22 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 2
First delete line num 13 and line 2 . And the program work fine 😁
20th Sep 2020, 5:41 PM
kellouche dhiya
kellouche dhiya - avatar
+ 2
Martin Taylor I have a question . Does getch() function belong in conio.h header file or curses.h header file? Since he included curses.h that's why I am asking.
21st Sep 2020, 4:06 PM
The future is now thanks to science
The future is now thanks to science - avatar
+ 1
You put wrong function
21st Sep 2020, 7:12 AM
Md Mehedi Islam Khan Ifti
Md Mehedi Islam Khan Ifti - avatar