ERROR: PHP Parse" /> ERROR: PHP Parse" /> ERROR: PHP Parse"/>

I'm new to php I'm getting this error "PHP Parse error: syntax error, unexpected '$sum' (T_VARIABLE)"

672 views Asked by At

This is the code


<?php


$sum=1+1;
$sub=1-1;
$div=1/1;
$mult=1*1;
printf("SUM:%d\nSUB:%d\nDIV:%d\nMULTI:%d\n",$sum,$sub,$div,$mult);

?>

ERROR:

PHP Parse error: syntax error, unexpected '$sum' (T_VARIABLE) in /var/labsstorage/home/Jaswanth/files/test.php on line 40

1

There are 1 answers

1
Anowar Hosen On

Try this:

echo "SUM:".$sum."SUB:".$sub."DIV:".$div."MULTI:".$mult;