#include&lt;stdio.h&gt;<br>#include &quot;/usr/include/libpq-fe.h&quot;<br><br>void main()<br>{<br><br>PGconn *conn;<br>PGresult *res;<br>int id;<br>char name[20];<br>char *qur;<br><br>conn = PQsetdbLogin(&quot;127.0.0.1&quot;,&quot;5432&quot;,NULL,NULL,&quot;postgres&quot;,&quot;postgres&quot;,NULL);<br>
<br><br>  if(PQstatus(conn)==CONNECTION_OK)<br>  {<br>    printf(&quot;Connection Established\n\n&quot;);<br> <br>    <br>   printf(&quot;Enter the ID: \n&quot;);<br>   scanf(&quot;%d&quot;,&amp;id);<br>   printf(&quot;Enter the NAME: \n&quot;);<br>
   scanf(&quot;%s&quot;,&amp;name);<br>  *qur=&quot;insert into table values(id,name)&quot;;      &lt;--------Error here, Why?<br>   res = PQexec(conn,qur);<br><br>    PQfinish(conn);<br>   }<br>   else<br>   {<br>     printf(&quot;Connection Failed\n&quot;);<br>
   }<br><br><br>}<br>