wp_query while have_posts the_post code example

Example 1: have_posts()

NOTE: The functions, have_posts(); and the_post(); are tied to the default automatic query that wordpress makes
on its on using the current URL.

Example 2: have_posts args

<?php
$args = array(
	'post__not_in'=>array($array),
    'post_type' => 'post',
    );
	
$the_query = new WP_Query($args);

if($the_query->have_posts()):

while ($the_query->have_posts()) : $the_query->the_post();
	// Process Your Statements
	//ex the_content()
	echo the_title();
endwhile;

endif;
?>