I am using below code to display iframe
<iframe src="www.w3schools.com" width="100%">
<p>Your browser does not support iframes.</p>
</iframe>
But it is not working and showing result like.

and when I check console and found

I am using below code to display iframe
<iframe src="www.w3schools.com" width="100%">
<p>Your browser does not support iframes.</p>
</iframe>
But it is not working and showing result like.

and when I check console and found

<iframe src="https://www.w3schools.com" width="100%">
<p>Your browser does not support iframes.</p>
</iframe>
That's what you see in console when you inspect the page.
Refused to display 'https://www.w3schools.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
You cannot use all the sites to be shown within the iframe on your site. Here is a good read on this issue.
Use this code:
<iframe src="<?php echo site_url('www.w3schools.com');?>"> </iframe>
The error is because you are accessing w3schools.com, this causes the browser to 'think' which is a file, not a complete url.
The correct one is https://www.example.com or http://www.example.com
Before adding a site to an iframe, you should check the headers that the site brings in the response. At the w3schools.com site, the server reports the x-frame-options: SAMEORIGIN header.
This header informs whether or not the site can be added to an iframe, frame, or object. When the header value is SAMEORIGIN, only the w3schools.com site can add its pages to the iframe.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
Your browser does not support iframes.
I am using this code, now let me know what's the cause ? – Tapeshwar Kumar Jan 01 '18 at 06:54