+ 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() ;
}
+ 2
First delete line num 13 and line 2 . And the program work fine đ
+ 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.
+ 1
You put wrong function