call of nonfunction in function main <>

i am getting call of nonfunction in function main <> error and 's' is assigned a value that is never used in the function warning...can anybody tell me why?Thanks..!!!
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

int main()
{
float a,b,c,s,area;

cout << "Enter Length of the side a of the triangle:"<<endl;
cin >> a;

cout << "Enter Length of the side b of the triangle:"<<endl;
cin >> b;

cout << "Enter Length of the side c of the triangle:"<<endl;
cin >> c;

s =(1/2)*(a+b+c);
area = sqrt(s*(s-a)*s(s-b)*(s-c));

cout << " The area is:" << area << endl;

return 0;
Last edited on
Is this line correct??
area = sqrt(s*(s-a)*s(s-b)*(s-c));
yes,i think so..do you see any mistake there?
Of course there is an error there.

1
2
3
4
5
    //s =(1/2)*(a+b+c); //ERROR  integer division... 1/2  will give value of zero 
    s =(a+b+c)/2;
    
    //area = sqrt(s*(s-a)*s(s-b)*(s-c)); ERROR - stray unwanted s in the formula.
    area = sqrt(s*(s-a)*(s-b)*(s-c)); // 
Topic archived. No new replies allowed.