Why this c program not show output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why this c program not show output

#include<stdio.h> #include<conio.h> #include<math.h> void main() { double a, b, c, s, area; clrscr(); printf("\nEnter the sides of triangle : \n"); scanf("%lf%lf%lf", &a, &b, &c); s = (a + b + c) / 2; area = sqrt(s * (s - a) * (s - b) * (s - c)); printf("\nArea of triangle using Heron's Formula : %.2lf", area); getch(); } https://www.sololearn.com/discuss/2272485/?ref=app

2nd May 2020, 7:55 PM
Aditya Singh
Aditya Singh - avatar
5 Answers
+ 3
From stackoverflow: "conio.h is a c header file used in old MS-DOS compilers... The #include <curses.h> will give you almost all the functionalities that was provided in conio.h" conio.h seems to be very depricated. ;)
2nd May 2020, 8:11 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
It works fine after removing conio.h file atleast on sololearn not sure about other platforms
2nd May 2020, 8:04 PM
Abhay
Abhay - avatar
0
Where you running this code..? What problem your getting? I executed it with output.. Aditya Singh Here, conio.h is deprecated api, don't works here. .. Remove conio.h, getch(), clrscr()... (But it works on old compliers, not here) Make int main() Put a space in scanf between specifiers..
2nd May 2020, 8:03 PM
Jayakrishna 🇮🇳
0
Thnkss alll
2nd May 2020, 8:13 PM
Aditya Singh
Aditya Singh - avatar
0
Thnks taylor
3rd May 2020, 5:42 AM
Aditya Singh
Aditya Singh - avatar