+ 3
How to post code?
how we can post code on sololearn platform?
12 Réponses
+ 11
just 3 simple steps:
1.make your code
2.save it and
3.make it public
+ 5
+ INSERT...
+ 4
on the computer copy and paste the address into your comment
+ 4
l
l
l
V
+ 3
On the app press insert on a new comment
there
l
l
V
+ 2
are you on mobile or on pc?
+ 2
@vinny
I'm on mobile
+ 2
alright. on android like @Manual said there's an insert button. from there you would go to my codes and put the code you wish there. otherwise another way is just to copy the address
+ 1
@PR
PLZZ
give me an example
+ 1
@vinny
I couldn't understand
0
<?php
$host ="localhost";
$dbUsername ="root";
$dbPassword ="";
$dbname ="nairobits";
//create connection
$conn = new mysqli($host, $dbUsername, $dbPassword, $dbname);
//check connection
if ($conn->connect_error) {
die( "connection failed: " .$conn->connect_error);
}
echo "connect successfully";
echo "<br>";
if (isset($_POST['VALUES'])) {
$name=$_POST['name'];
$location=$_POST['location'];
$email=$_POST['email'];
$password=$_POST['password'];
$sql="INSERT INTO cbo(name,location,email,password);
VALUES('$name','$location','email',$email',$password)";
}
echo "New record created successfully";
mysqli_close($conn);
?>
why cannt it post
0
#include <iostream>
using namespace std;
/*Program to calculate maximum ,minimum and average using functions*/
void calculate_minimum_maximum_average(int [],int,int &p,int &q,double &r);
int main()
{
int a[50],n,p,q;
double r;
cout<<"Enter number of elements:";
cin>>n;
cout<<"Enter the elements of array:";
for(int i=0;i<n;i++)
cin>>a[i];
calculate_minimum_maximum_average(a,n,p,q,r);
cout<<"Minimum="<<p<<endl;
cout<<"Maximum="<<q<<endl;
cout<<"Average="<<r<<endl;
}
void calculate_minimum_maximum_average (int b[],int size,int &min,int &max,double &avg)
{
int min=b[0];
for(int i=0;i<size;i++)
{ if(b[i]<min)
{min=b[i];}
}
int max=b[0];
for(int i=0;i<size;i++)
{ if(b[i]>max)
{max=b[i];}
}
double sum=0;
double avg;
for(int i=0;i<size;i++)
{sum=sum+b[i];}
avg=sum/size;
}
What is wrong with this code?
I am getting errors