tag:blogger.com,1999:blog-39181746377874561962024-02-20T15:19:45.405-08:00Programming CodesAnonymoushttp://www.blogger.com/profile/03894453471904073565noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-3918174637787456196.post-50668527790284616992013-10-20T13:44:00.001-07:002013-10-21T08:11:16.132-07:00Panoramio Javascript API Widget 2<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<span style="font-size: large;">This is Panoramio JavaScriptt API. Panoramio JavaScriptt API let you customize it.</span><br />
<script src="https://ssl.panoramio.com/wapi/wapi.js?v=1&hl=en"></script>
<br />
<div id="wapiblock" style="float: left; margin: 10px 15px;">
</div>
<script type="text/javascript">
var myRequest = {
'tag': 'austria',
'rect': {'sw': {'lat': -30, 'lng': 10.5}, 'ne': {'lat': 50.5, 'lng': 30}}
};
var myOptions = {
'width': 600,
'height': 500
};
var wapiblock = document.getElementById('wapiblock');
var photo_widget = new panoramio.PhotoWidget('wapiblock', myRequest, myOptions);
photo_widget.setPosition(0);
</script>
</div>
<div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-size: large;">This is complete Code for Panoramio JavaScriptt API widget.It does not show in composing mood.It show after publishing it.</span></div>
<div>
<pre style="background: #042029; color: #839496;"><span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">div</span> <span style="color: #93a1a1;">dir</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>ltr<span style="color: #269186;">"</span></span> <span style="color: #93a1a1;">style</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>text-align: center;<span style="color: #269186;">"</span></span> <span style="color: #93a1a1;">trbidi</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>on<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">script</span> <span style="color: #93a1a1;">src</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>https://ssl.panoramio.com/wapi/wapi.js?v=1<span style="color: #cb4b16;">&amp;</span>hl=en<span style="color: #269186;">"</span></span><span style="color: #586e75;">></</span><span style="color: #268bd2; font-weight: 700;">script</span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">div</span> <span style="color: #93a1a1;">id</span><span style="color: #708284;">=</span><span style="color: #269186;"><span style="color: #269186;">"</span>wapiblock<span style="color: #269186;">"</span></span> <span style="color: #93a1a1;">style</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>float: right; margin: 10px 15px<span style="color: #269186;">"</span></span><span style="color: #586e75;">></</span><span style="color: #268bd2; font-weight: 700;">div</span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="font-style: italic;">script</span> <span style="color: #93a1a1;">type</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>text/javascript<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>
<span style="color: #268bd2;">var</span> myRequest <span style="color: #859900;">=</span> <span style="color: #268bd2;">{</span>
<span style="color: #269186;"><span style="color: #c60000;">'</span>tag<span style="color: #c60000;">'</span></span>: <span style="color: #269186;"><span style="color: #c60000;">'</span>sunset<span style="color: #c60000;">'</span></span>,
<span style="color: #269186;"><span style="color: #c60000;">'</span>rect<span style="color: #c60000;">'</span></span>: <span style="color: #268bd2;">{</span><span style="color: #269186;"><span style="color: #c60000;">'</span>sw<span style="color: #c60000;">'</span></span>: <span style="color: #268bd2;">{</span><span style="color: #269186;"><span style="color: #c60000;">'</span>lat<span style="color: #c60000;">'</span></span>: <span style="color: #859900;">-</span><span style="color: #269186;">30</span>, <span style="color: #269186;"><span style="color: #c60000;">'</span>lng<span style="color: #c60000;">'</span></span>: <span style="color: #269186;">10.5</span><span style="color: #268bd2;">}</span>, <span style="color: #269186;"><span style="color: #c60000;">'</span>ne<span style="color: #c60000;">'</span></span>: <span style="color: #268bd2;">{</span><span style="color: #269186;"><span style="color: #c60000;">'</span>lat<span style="color: #c60000;">'</span></span>: <span style="color: #269186;">50.5</span>, <span style="color: #269186;"><span style="color: #c60000;">'</span>lng<span style="color: #c60000;">'</span></span>: <span style="color: #269186;">30</span><span style="color: #268bd2;">}</span><span style="color: #268bd2;">}</span>
<span style="color: #268bd2;">}</span>;
<span style="color: #268bd2;">var</span> myOptions <span style="color: #859900;">=</span> <span style="color: #268bd2;">{</span>
<span style="color: #269186;"><span style="color: #c60000;">'</span>width<span style="color: #c60000;">'</span></span>: <span style="color: #269186;">300</span>,
<span style="color: #269186;"><span style="color: #c60000;">'</span>height<span style="color: #c60000;">'</span></span>: <span style="color: #269186;">200</span>
<span style="color: #268bd2;">}</span>;
<span style="color: #268bd2;">var</span> wapiblock <span style="color: #859900;">=</span> <span style="color: #859900;">document</span>.<span style="color: #a57800;">getElementById</span><span style="color: #93a1a1;">(</span><span style="color: #269186;"><span style="color: #c60000;">'</span>wapiblock<span style="color: #c60000;">'</span></span><span style="color: #93a1a1;">)</span>;
<span style="color: #268bd2;">var</span> photo_widget <span style="color: #859900;">=</span> <span style="color: #859900;">new</span> panoramio.PhotoWidget<span style="color: #93a1a1;">(</span><span style="color: #269186;"><span style="color: #c60000;">'</span>wapiblock<span style="color: #c60000;">'</span></span>, myRequest, myOptions<span style="color: #93a1a1;">)</span>;
photo_widget.setPosition<span style="color: #93a1a1;">(</span><span style="color: #269186;">0</span><span style="color: #93a1a1;">)</span>;
<span style="color: #586e75;"></</span><span style="font-style: italic;">script</span><span style="color: #586e75;">></span>
<span style="color: #586e75;"></</span><span style="color: #268bd2; font-weight: 700;">div</span><span style="color: #586e75;">></span>
</pre>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/03894453471904073565noreply@blogger.com0tag:blogger.com,1999:blog-3918174637787456196.post-33246709816009601212013-10-20T05:36:00.000-07:002013-10-21T03:28:01.078-07:00Panoramio Javascript API Widget example 1<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: large;">this is Panoramio JavaScript API Widget example.</span><br />
<div style="text-align: left;">
<script src="https://ssl.panoramio.com/wapi/wapi.js?v=1&hl=en"></script>
<style type="text/css">
#div_attr_ex .panoramio-wapi-images {
background-color: transparent;
}
#div_attr_ex .pwanoramio-wapi-tos{
background-color: transparent !important;
}
</style>
</div>
<div id="div_attr_ex">
<div id="div_attr_ex_photo">
</div>
<div id="div_attr_ex_attr">
</div>
</div>
<script type="text/javascript">
function increase ()
{
var temp = parseInt (document . apple . banana . value);
if (isNaN (temp))
return;
if (temp>=0 )
{
attr_ex_photo_widget.setPosition(temp);
document . apple . banana . value = temp;
label = {'tag': 'austria'};
}
else
{
attr_ex_photo_widget.setPosition(0);
document . apple . banana . value = 0;
}
}
var position;
var end;
function myfunction(no)
{
position =attr_ex_photo_widget.getPosition();
no=position+no;
end=attr_ex_photo_widget.getAtEnd();
if (no>=0 && !end)
{
attr_ex_photo_widget.setPosition(no);
document . apple . banana . value = no;
}
else
{
no=0;
attr_ex_photo_widget.setPosition(no);
document . apple . banana . value = no;
}
}
var no=0;
var label = {'tag': 'sand'};
var tagRequest = new panoramio.PhotoRequest(label);
var attr_ex_photo_options = {
'width': 600,
'height': 500,
'attributionStyle': panoramio.tos.Style.HIDDEN};
var attr_ex_photo_widget = new panoramio.PhotoWidget(
'div_attr_ex_photo', tagRequest, attr_ex_photo_options);
var attr_ex_attr_options = {'width':600};
var attr_ex_attr_widget = new panoramio.TermsOfServiceWidget(
'div_attr_ex_attr', attr_ex_attr_options);
attr_ex_photo_widget.enablePreviousArrow(true);
attr_ex_photo_widget.enableNextArrow(true);
attr_ex_photo_widget.setPosition(2);
</script>
<button onclick="myfunction(1)">next</button><button onclick="myfunction(-1)">previous</button>
<br />
<form name="apple">
<input min="0" name="banana" size="5" type="number" />
<input onclick="increase ();" type="button" value="View" />
<br />
<br />
<span style="font-size: large;">Panoramio JavaScript API Widget does not show by composing, it show when it will be published.</span><span style="font-size: large;">It is full code just copy paste it.</span></form>
</div>
<pre style="background: #042029; color: #839496;"><span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">div</span> <span style="color: #93a1a1;">dir</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>ltr<span style="color: #269186;">"</span></span> <span style="color: #93a1a1;">style</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>text-align: left;<span style="color: #269186;">"</span></span> <span style="color: #93a1a1;">trbidi</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>on<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>
this is<span style="color: #cb4b16;">&nbsp;</span>Panoramio Javascript API Widget example.<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">br</span><span style="color: #586e75;"> /></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">div</span> <span style="color: #93a1a1;">style</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>text-align: left;<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">script</span> <span style="color: #93a1a1;">src</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>https://ssl.panoramio.com/wapi/wapi.js?v=1<span style="color: #cb4b16;">&amp;</span>hl=en<span style="color: #269186;">"</span></span><span style="color: #586e75;">></</span><span style="color: #268bd2; font-weight: 700;">script</span><span style="color: #586e75;">></span>
<span style="color: #819090; font-style: italic;"><span style="color: #586e75;"><</span><span style="font-style: italic;">style</span> <span style="color: #93a1a1;">type</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>text/css<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>
<span style="color: #536871;"> <span style="color: #268bd2;">#div_attr_ex</span> <span style="color: #268bd2;">.panoramio-wapi-images</span> </span>{
background-color: transparent;
}
<span style="color: #536871;"> <span style="color: #268bd2;">#div_attr_ex</span> <span style="color: #268bd2;">.pwanoramio-wapi-tos</span></span>{
background-color: transparent !important;
}
<span style="color: #586e75;"></</span><span style="font-style: italic;">style</span><span style="color: #586e75;">></span></span>
<span style="color: #586e75;"></</span><span style="color: #268bd2; font-weight: 700;">div</span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">div</span> <span style="color: #93a1a1;">id</span><span style="color: #708284;">=</span><span style="color: #269186;"><span style="color: #269186;">"</span>div_attr_ex<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">div</span> <span style="color: #93a1a1;">id</span><span style="color: #708284;">=</span><span style="color: #269186;"><span style="color: #269186;">"</span>div_attr_ex_photo<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>
<span style="color: #586e75;"></</span><span style="color: #268bd2; font-weight: 700;">div</span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">div</span> <span style="color: #93a1a1;">id</span><span style="color: #708284;">=</span><span style="color: #269186;"><span style="color: #269186;">"</span>div_attr_ex_attr<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>
<span style="color: #586e75;"></</span><span style="color: #268bd2; font-weight: 700;">div</span><span style="color: #586e75;">></span>
<span style="color: #586e75;"></</span><span style="color: #268bd2; font-weight: 700;">div</span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="font-style: italic;">script</span> <span style="color: #93a1a1;">type</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>text/javascript<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>
<span style="color: #a57800;"><span style="color: #268bd2;">function</span> <span style="color: #a57800;">increase</span> <span style="color: #93a1a1;">(</span>)</span>
<span style="color: #268bd2;">{</span>
<span style="color: #268bd2;">var</span> temp <span style="color: #859900;">=</span> parseInt <span style="color: #93a1a1;">(</span><span style="color: #859900;">document</span> . apple . banana . value<span style="color: #93a1a1;">)</span>;
<span style="color: #859900;">if</span> <span style="color: #93a1a1;">(</span>isNaN <span style="color: #93a1a1;">(</span>temp<span style="color: #93a1a1;">)</span><span style="color: #93a1a1;">)</span>
<span style="color: #859900;">return</span>;
<span style="color: #859900;">if</span> <span style="color: #93a1a1;">(</span>temp<span style="color: #859900;">>=</span><span style="color: #269186;">0</span> <span style="color: #93a1a1;">)</span>
<span style="color: #268bd2;">{</span>
attr_ex_photo_widget.setPosition<span style="color: #93a1a1;">(</span>temp<span style="color: #93a1a1;">)</span>;
<span style="color: #268bd2;">}</span>
<span style="color: #859900;">else</span>
<span style="color: #268bd2;">{</span>
attr_ex_photo_widget.setPosition<span style="color: #93a1a1;">(</span><span style="color: #269186;">0</span><span style="color: #93a1a1;">)</span>;
<span style="color: #859900;">document</span> . apple . banana . value <span style="color: #859900;">=</span> <span style="color: #269186;">0</span>;
<span style="color: #268bd2;">}</span>
<span style="color: #268bd2;">}</span>
<span style="color: #268bd2;">var</span> position;
<span style="color: #268bd2;">var</span> end;
<span style="color: #a57800;"><span style="color: #268bd2;">function</span> <span style="color: #a57800;">myfunction</span>(no)</span>
<span style="color: #268bd2;">{</span>
position <span style="color: #859900;">=</span>attr_ex_photo_widget.getPosition<span style="color: #93a1a1;">(</span><span style="color: #93a1a1;">)</span>;
no<span style="color: #859900;">=</span>position<span style="color: #859900;">+</span>no;
end<span style="color: #859900;">=</span>attr_ex_photo_widget.getAtEnd<span style="color: #93a1a1;">(</span><span style="color: #93a1a1;">)</span>;
<span style="color: #859900;">if</span> <span style="color: #93a1a1;">(</span>no<span style="color: #859900;">>=</span><span style="color: #269186;">0</span> <span style="color: #859900;">&</span><span style="color: #859900;">&</span> <span style="color: #859900;">!</span>end<span style="color: #93a1a1;">)</span>
<span style="color: #268bd2;">{</span>
attr_ex_photo_widget.setPosition<span style="color: #93a1a1;">(</span>no<span style="color: #93a1a1;">)</span>;
<span style="color: #859900;">document</span> . apple . banana . value <span style="color: #859900;">=</span> no;
<span style="color: #268bd2;">}</span>
<span style="color: #859900;">else</span>
<span style="color: #268bd2;">{</span>
no<span style="color: #859900;">=</span><span style="color: #269186;">0</span>;
attr_ex_photo_widget.setPosition<span style="color: #93a1a1;">(</span>no<span style="color: #93a1a1;">)</span>;
<span style="color: #859900;">document</span> . apple . banana . value <span style="color: #859900;">=</span> no;
<span style="color: #268bd2;">}</span>
<span style="color: #268bd2;">}</span>
<span style="color: #268bd2;">var</span> no<span style="color: #859900;">=</span><span style="color: #269186;">0</span>;
<span style="color: #268bd2;">var</span> label <span style="color: #859900;">=</span> <span style="color: #268bd2;">{</span><span style="color: #269186;"><span style="color: #c60000;">'</span>tag<span style="color: #c60000;">'</span></span>: <span style="color: #269186;"><span style="color: #c60000;">'</span>kahna<span style="color: #c60000;">'</span></span><span style="color: #268bd2;">}</span>;
<span style="color: #268bd2;">var</span> tagRequest <span style="color: #859900;">=</span> <span style="color: #859900;">new</span> panoramio.PhotoRequest<span style="color: #93a1a1;">(</span>label<span style="color: #93a1a1;">)</span>;
<span style="color: #268bd2;">var</span> attr_ex_photo_options <span style="color: #859900;">=</span> <span style="color: #268bd2;">{</span>
<span style="color: #269186;"><span style="color: #c60000;">'</span>width<span style="color: #c60000;">'</span></span>: <span style="color: #269186;">600</span>,
<span style="color: #269186;"><span style="color: #c60000;">'</span>height<span style="color: #c60000;">'</span></span>: <span style="color: #269186;">500</span>,
<span style="color: #269186;"><span style="color: #c60000;">'</span>attributionStyle<span style="color: #c60000;">'</span></span>: panoramio.tos.<span style="color: #859900;">Style</span>.HIDDEN<span style="color: #268bd2;">}</span>;
<span style="color: #268bd2;">var</span> attr_ex_photo_widget <span style="color: #859900;">=</span> <span style="color: #859900;">new</span> panoramio.PhotoWidget<span style="color: #93a1a1;">(</span>
<span style="color: #269186;"><span style="color: #c60000;">'</span>div_attr_ex_photo<span style="color: #c60000;">'</span></span>, tagRequest, attr_ex_photo_options<span style="color: #93a1a1;">)</span>;
<span style="color: #268bd2;">var</span> attr_ex_attr_options <span style="color: #859900;">=</span> <span style="color: #268bd2;">{</span><span style="color: #269186;"><span style="color: #c60000;">'</span>width<span style="color: #c60000;">'</span></span>:<span style="color: #269186;">600</span><span style="color: #268bd2;">}</span>;
<span style="color: #268bd2;">var</span> attr_ex_attr_widget <span style="color: #859900;">=</span> <span style="color: #859900;">new</span> panoramio.TermsOfServiceWidget<span style="color: #93a1a1;">(</span>
<span style="color: #269186;"><span style="color: #c60000;">'</span>div_attr_ex_attr<span style="color: #c60000;">'</span></span>, attr_ex_attr_options<span style="color: #93a1a1;">)</span>;
attr_ex_photo_widget.enablePreviousArrow<span style="color: #93a1a1;">(</span><span style="color: #b58900;">true</span><span style="color: #93a1a1;">)</span>;
attr_ex_photo_widget.enableNextArrow<span style="color: #93a1a1;">(</span><span style="color: #b58900;">true</span><span style="color: #93a1a1;">)</span>;
attr_ex_photo_widget.setPosition<span style="color: #93a1a1;">(</span><span style="color: #269186;">2</span><span style="color: #93a1a1;">)</span>;
<span style="color: #586e75;"></</span><span style="font-style: italic;">script</span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">button</span> <span style="color: #93a1a1;">onclick</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>myfunction(1)<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>next<span style="color: #586e75;"></</span><span style="color: #268bd2; font-weight: 700;">button</span><span style="color: #586e75;">></span><span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">button</span> <span style="color: #93a1a1;">onclick</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>myfunction(-1)<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>previous<span style="color: #586e75;"></</span><span style="color: #268bd2; font-weight: 700;">button</span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">br</span><span style="color: #586e75;"> /></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">form</span> <span style="color: #93a1a1;">name</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>apple<span style="color: #269186;">"</span></span><span style="color: #586e75;">></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">input</span> <span style="color: #93a1a1;">min</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>0<span style="color: #269186;">"</span></span> <span style="color: #93a1a1;">name</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>banana<span style="color: #269186;">"</span></span> <span style="color: #93a1a1;">size</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>5<span style="color: #269186;">"</span></span> <span style="color: #93a1a1;">type</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>number<span style="color: #269186;">"</span></span><span style="color: #586e75;"> /></span>
<span style="color: #586e75;"><</span><span style="color: #268bd2; font-weight: 700;">input</span> <span style="color: #93a1a1;">onclick</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>increase ();<span style="color: #269186;">"</span></span> <span style="color: #93a1a1;">type</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>button<span style="color: #269186;">"</span></span> <span style="color: #93a1a1;">value</span>=<span style="color: #269186;"><span style="color: #269186;">"</span>View<span style="color: #269186;">"</span></span><span style="color: #586e75;"> /></span>
<span style="color: #586e75;"></</span><span style="color: #268bd2; font-weight: 700;">form</span><span style="color: #586e75;">></span>
<span style="color: #586e75;"></</span><span style="color: #268bd2; font-weight: 700;">div</span><span style="color: #586e75;">></span>
</pre>
</div>Anonymoushttp://www.blogger.com/profile/03894453471904073565noreply@blogger.com0tag:blogger.com,1999:blog-3918174637787456196.post-39794108651706761992013-10-08T23:18:00.001-07:002013-10-09T08:32:11.403-07:00insert at start and end in Link list by head and tale method with clases in c++<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: #666666;"><span style="color: #444444;"><span style="font-size: large;"><a><span style="color: #666666;"><span style="background-color: white;">In this program user can insert data at start and end in link list by using head and tale method.user can also display </span></span><span style="font-size: large;"><span style="color: #666666;"><span style="background-color: white;">and search data in link list.</span></span><span style="font-size: large;"><span style="color: #666666;"><span style="background-color: white;">It is com</span></span><span style="font-size: large;"><span style="background-color: white;"><span style="color: #666666;">plete program with Menu.</span></span><span style="background-color: black;"></span></span></span></span></a></span></span></span><br />
<br />
<span style="font-size: large;"><span style="font-size: large;"><span style="font-size: large;"><span style="font-size: large;"> </span></span></span></span>
<br />
<div style="background-color: #eaeae8; border: 7px solid rgb(249,249,249); color: black; line-height: 1.9em; margin: 1px; outline: rgb(203,203,203) solid 1px; padding: 3px;" table="">
<br />
<pre style="background: #eaeae8; color: black;">#include<iostream>
<span style="color: #2060a0;">using</span> <span style="color: #a08000;">namespace</span> std;
<span style="color: #a08000;">class</span> Node{
public:
int data;
Node *nextptr;
};
<span style="color: #a08000;">class</span> Linklist {
Node *head;
Node *tale;
public:
<span style="color: maroon;">Linklist</span>();
Node* insertAtStart(int element);
Node* insertAtEnd(int element);
~Linklist();
void print();
bool search(int element);
Node* First_Record(int element);
friend <span style="color: #a08000;">class</span> Node;
};
<span style="color: maroon;">Linklist::Linklist</span>()
{
head=NULL;
}
Node* <span style="color: maroon;">Linklist::First_Record</span>(int element)
{
Node *ptr;
ptr=new Node;
ptr->data=element;
ptr->nextptr=NULL;
head=tale=ptr;
return ptr;
}
Node* <span style="color: maroon;">Linklist::insertAtStart</span>(int element)
{
if(head==NULL)
{
return First_Record(element);
}
Node *ptr;
ptr=new Node;
ptr->data=element;
ptr->nextptr=head;
head=ptr;
return ptr;
}
Node* <span style="color: maroon;">Linklist::insertAtEnd</span>(int element)
{
Node *ptr;
if(head==NULL)
return First_Record(element);
ptr=new Node;
ptr->data=element;
ptr->nextptr=NULL;
tale->nextptr = ptr;
tale= ptr;
return ptr;
}
<span style="color: #a08000;">void</span> <span style="color: maroon;">Linklist::print</span>()
{
Node *temp=head;
if(head!=NULL)
{
while(temp!=NULL)
{
cout<<temp->data<<" "<<endl;
temp=temp->nextptr;
}
}
else
cout<<"Ther is no data in list\n"<<endl;
}
<span style="color: maroon;">Linklist::~Linklist</span>()
{
Node *temp;
if(head!=NULL)
{
while(head!=NULL)
{
temp=head;
head=head->nextptr;
delete temp;
}
}
}
<span style="color: #a08000;">bool</span> <span style="color: maroon;">Linklist::search</span>(int element)
{
Node *temp;
if(head!=NULL)
{
temp=head;
while( temp!=NULL)
{
if(temp->data==element)
return true;
temp=temp->nextptr;
}
return false;
}
else
return false;
}
<span style="color: #a08000;">int</span> <span style="color: maroon;">main</span>()
{
int choice=0;
int data;
Linklist object;
cout<<"enter your choice"<<endl;
while(1)
{
cout<<"\nMenu:\n1: insert at start"<<endl;
cout<<"2: insert at end"<<endl;
cout<<"3: print elements"<<endl;
cout<<"4: search a elelment"<<endl;
cout<<"5: delete linlist"<<endl;
cout<<"6: exit"<<endl;
cout<<"enter your choice"<<endl;
cin>>choice;
switch(choice)
{
case 1:
cout<<"enter number"<<endl;
cin>>data;
object.insertAtStart(data);
break;
case 2:
cout<<"enter number"<<endl;
cin>>data;
object.insertAtEnd(data);
break;
case 3:
cout<<"element are"<<endl;
object.print();
break;
case 4:
cout<<"enter number"<<endl;
cin>>data;
if(object.search(data))
{
cout<<"number found in the list";
}
else
cout<<"number not found in the list";
break;
case 5:
object.~Linklist();
break;
case 6:
exit(1);
break;
default:
cout<<"invalid choice"<<endl;
break;
}
}
system("pause");
}
</pre>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/03894453471904073565noreply@blogger.com0tag:blogger.com,1999:blog-3918174637787456196.post-80011367007302873112013-10-03T17:57:00.003-07:002013-10-03T20:45:14.896-07:00print Array in C++<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
</div>
<table style="background-color: #eaeae8; border: 7px solid rgb(249,249,249); color: black; line-height: 1.9em; margin: 1px; outline: rgb(203,203,203) solid 1px; padding: 3px;">
<tbody>
<tr>
<td style="height: 187px; width: 474px;"><pre><b><span style="color: #cc3333; font-size: x-large; line-height: 13px;">#include<iostream></span></b></pre>
<pre><b><span style="font-size: x-large;"><span class="k" style="color: #0033cc; font-weight: bold; line-height: 13px;">using</span> <span class="k" style="color: #0033cc; font-weight: bold; line-height: 13px;">namespace</span> <span class="n">std</span><span class="p">;</span>
<span class="kt" style="color: #9966cc; font-weight: bold; line-height: 13px;">void</span> <span class="n">main</span><span class="p">()</span>
<span class="p">{</span>
<span class="kt" style="color: #9966cc; font-weight: bold; line-height: 13px;">int</span> <span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">5</span><span class="p">]</span><span class="o">=</span><span class="p">{</span><span class="mi" style="line-height: 13px;">1</span><span class="p">,</span><span class="mi" style="line-height: 13px;">2</span><span class="p">,</span><span class="mi" style="line-height: 13px;">3</span><span class="p">,</span><span class="mi" style="line-height: 13px;">4</span><span class="p">,</span><span class="mi" style="line-height: 13px;">5</span><span class="p">};</span>
<span class="n">cout</span><span class="o"><<</span><span class="s" style="color: #cc9933; font-weight: bold; line-height: 13px;">"Array elements are \n"</span></span></b></pre>
<pre><b><span style="font-size: x-large;"><span class="o"><<</span><span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">0</span><span class="p">]</span></span></b><b style="line-height: 1.9em;"><span style="font-size: x-large;"><span class="o"><<</span><span class="s" style="color: #cc9933; line-height: 13px;">"\n"</span></span></b></pre>
<pre><b style="line-height: 1.9em;"><span style="font-size: x-large;"><span class="o"><<</span><span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">1</span><span class="p">]</span></span></b><b style="line-height: 1.9em;"><span style="font-size: x-large;"><span class="o"><<</span><span class="s" style="color: #cc9933; line-height: 13px;">"\n"</span></span></b></pre>
<pre><b style="line-height: 1.9em;"><span style="font-size: x-large;"><span class="o"><<</span><span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">2</span><span class="p">]</span><span class="o"><<</span><span class="s" style="color: #cc9933; line-height: 13px;">"\n"</span></span></b></pre>
<pre><b style="line-height: 1.9em;"><span style="font-size: x-large;"><span class="o"><<</span><span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">3</span><span class="p">]</span><span class="o"><<</span><span class="s" style="color: #cc9933; line-height: 13px;">"\n"</span></span></b></pre>
<pre><b style="line-height: 1.9em;"><span style="font-size: x-large;"><span class="o"><<</span><span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">4</span><span class="p">]</span><span class="o"><<</span><span class="n">endl</span><span class="p">;</span></span></b></pre>
<pre><b><span style="font-size: x-large;">
<span class="n">system</span><span class="p">(</span><span class="s" style="color: #cc9933; font-weight: bold; line-height: 13px;">"pause"</span><span class="p">);</span>
<span class="p">}</span></span></b></pre>
</td></tr>
</tbody></table>
</div>
Anonymoushttp://www.blogger.com/profile/03894453471904073565noreply@blogger.com0tag:blogger.com,1999:blog-3918174637787456196.post-83884121520296533842013-10-03T17:50:00.003-07:002013-10-08T22:41:50.135-07:00Print Array in C Language<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
</div>
<table style="background-color: #eaeae8; border: 7px solid rgb(249,249,249); color: black; line-height: 1.9em; margin: 1px; outline: rgb(203,203,203) solid 1px; padding: 3px;">
<tbody>
<tr>
<td style="height: 187px; width: 474px;"><pre><b><span style="font-size: x-large;"><span style="color: #cc3333; line-height: 13px;">#include<stdio.h></span>
<span class="cp" style="color: #cc3333; line-height: 13px;">#include<stdlib.h></span>
<span class="kt" style="color: #9966cc; line-height: 13px;">void</span> <span class="nf">main</span><span class="p">()</span>
<span class="p">{</span>
<span class="kt" style="color: #9966cc; line-height: 13px;">int</span> <span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">5</span><span class="p">]</span><span class="o">=</span><span class="p">{</span><span class="mi" style="line-height: 13px;">1</span><span class="p">,</span><span class="mi" style="line-height: 13px;">2</span><span class="p">,</span><span class="mi" style="line-height: 13px;">3</span><span class="p">,</span><span class="mi" style="line-height: 13px;">4</span><span class="p">,</span><span class="mi" style="line-height: 13px;">5</span><span class="p">};</span>
<span class="n">printf</span><span class="p">(</span><span class="s" style="color: #cc9933; line-height: 13px;">"array element are =</span></span></b></pre>
<pre><b><span style="font-size: x-large;"><span class="s" style="color: #cc9933; line-height: 13px;"> %d,%d,%d,%d,%d</span><span class="se" style="color: #cc9933; line-height: 13px;">\n</span><span class="s" style="color: #cc9933; line-height: 13px;">"</span>
<span class="p">,</span><span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">0</span><span class="p">],</span><span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">1</span><span class="p">],</span><span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">2</span><span class="p">],</span><span class="n"> </span></span></b></pre>
<pre><b><span style="font-size: x-large;"><span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">3</span><span class="p">],</span><span class="n">aray</span><span class="p">[</span><span class="mi" style="line-height: 13px;">4</span><span class="p">])</span> <span class="p">;</span>
<span class="n">system</span><span class="p">(</span><span class="s" style="color: #cc9933; line-height: 13px;">"pause"</span><span class="p">);</span>
<span class="p">}</span></span></b></pre>
</td></tr>
</tbody></table>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/03894453471904073565noreply@blogger.com0tag:blogger.com,1999:blog-3918174637787456196.post-83868952937641804212013-09-15T05:59:00.001-07:002013-10-03T18:18:59.911-07:00Input & Output in C++<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
</div>
<table style="background-color: #eaeae8; border: 7px solid rgb(249,249,249); color: black; line-height: 1.9em; margin: 1px; outline: rgb(203,203,203) solid 1px; padding: 3px;"><tbody>
<tr><td style="height: 187px; width: 474px;"><pre><b><span style="font-family: inherit; font-size: x-large;"><span style="color: #cc3333; line-height: 13px;">#include<iostream></span>
<span style="color: #0033cc; line-height: 13px;">using</span> <span style="color: #0033cc; line-height: 13px;">namespace</span> std;
<span style="color: #9966cc; line-height: 13px;">void</span> main()
{
<span style="color: #9966cc; line-height: 13px;">int</span> input;
cout<<<span style="color: #cc9933; line-height: 13px;">"enter a number :"</span>;
cin>>input;
cout<<<span style="color: #cc9933; line-height: 13px;">"input is = "</span><< input<<endl;
system(<span style="color: #cc9933; line-height: 13px;">"pause"</span>);
}</span></b></pre>
</td>
</tr>
</tbody>
</table>
</div>
Anonymoushttp://www.blogger.com/profile/03894453471904073565noreply@blogger.com0tag:blogger.com,1999:blog-3918174637787456196.post-35005627190202604642013-09-15T05:57:00.001-07:002013-10-03T18:16:37.179-07:00Hello World in C++<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
</div>
<table style="background-color: #eaeae8; border: 7px solid rgb(249,249,249); color: black; line-height: 1.5em; margin: 1px; outline: rgb(203,203,203) solid 1px; padding: 3px;">
<tbody>
<tr>
<td style="height: 187px; width: 474px;"><pre><span style="font-size: x-large;"><b><span style="color: #cc3333; line-height: 13px;">#include<iostream></span>
</b><b style="line-height: 1.5em;">using <span style="color: #0033cc; line-height: 13px;">namespace</span> std;</b></span></pre>
<pre><b><span style="font-size: x-large;">
<span style="color: #9966cc; font-weight: bold; line-height: 13px;">void</span> main()
{
cout<<<span style="color: #cc9933; font-weight: bold; line-height: 13px;">"hello world</span><span style="color: #cc9933; font-weight: bold; line-height: 13px;">\n</span><span style="color: #cc9933; font-weight: bold; line-height: 13px;">"</span>;
system(<span style="color: #cc9933; font-weight: bold; line-height: 13px;">"pause"</span>);
}</span></b></pre>
</td>
</tr>
</tbody>
</table>
</div>
Anonymoushttp://www.blogger.com/profile/03894453471904073565noreply@blogger.com0tag:blogger.com,1999:blog-3918174637787456196.post-854647837185550882013-09-15T05:55:00.001-07:002013-10-03T18:15:46.837-07:00First Program in C , Hello World<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
</div>
<table style="background-color: #eaeae8; border: 7px solid rgb(249,249,249); color: black; margin: 1px; outline: rgb(203,203,203) solid 1px; padding: 3px;">
<tbody>
<tr>
<td style="height: 187px; width: 474px;"><pre><span style="font-size: x-large;"><b><span style="color: #cc3333;">#include<stdio.h></span>
<span style="color: #cc3333;">#include<stdlib.h></span>
<span style="color: #9966cc;">void</span> main()
{
printf(<span style="color: #cc9933;">"Hello World!</span><span style="color: #cc9933; line-height: 1.9em;">\n</span><span style="color: #cc9933;">"</span>);
system(<span style="color: #cc9933;">"pause"</span>);
}</b></span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<b><b></b></b></div>
Anonymoushttp://www.blogger.com/profile/03894453471904073565noreply@blogger.com0