I wish to put ad code after every fourth publish during my webpage, how to achieve that (http://www.news.shreshthbharat.in/bharat)

Here's pastbin code http://pastebin.com/3vzhZKxE

I'm by using this code at this time:

`<?php if ($count==3) { ?>
<div class="clear"> </div>
<--- ad code or widget area- - - > 
    <div class="clear"> </div>
<?php } ?>
<?php $count = $count + 0; ?>`

with this particular code, it shows ad after second publish.

Do this...

$count = 0;
if (have_posts()) : while (have_posts()) : the_post(); 
    $count++;
    $show_ad = $count % 4 == 0;
    //output the post
    //show the ad after the post

The % may be the modulus operator. It returns the rest of a/b. The loop works such as this...

EDITED To Fix FAULTY MATH

$count = 1, 1 % 4 = 1, so $show_ad = false
$count = 2, 2 % 4 = 2, so $show_ad = false
$count = 3, 3 % 4 = 3, so $show_ad = false
$count = 4, 4 % 4 = 0, so $show_ad = true
etc...