<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Need some help in my program]]></title><description><![CDATA[<p>Hi , Every one I really need some help in my programs it doesn't work as I want I know there something wrong in it if you know where the wrong is jast show me plz as soon as Possible plzzzzz.<br />
I a Beginner in C++ ;</p>
<p>I will be thankful for you .</p>
<p>------------------------<br />
first program : I need the user to enter his/her ful name and then the program separate the string to first name , middle name and the last name which stord in three different strings .<br />
I do it like this ....<br />
#include&lt;iostream.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
#include&lt;ctype.h&gt;<br />
#include&lt;string.h&gt;<br />
main()<br />
{<br />
int i=1,j,d=0,k,tmp,x;<br />
char word[10],f[10],m[10],l[10];</p>
<p>cout&lt;&lt;&quot;Enter Your Full Name\n&quot;;</p>
<p>while(cin&gt;&gt;word){<br />
cout.width('\0');<br />
cout&lt;&lt;&quot;\n&quot;;<br />
if(word!='\0'){<br />
strcpy(f,word);<br />
cout&lt;&lt;&quot;\n Your First Name is.... \n&quot;;<br />
cout&lt;&lt;f; }<br />
strcpy(m,word);<br />
cout&lt;&lt;&quot;\n Your Middle Name is.... \n&quot;;<br />
cout&lt;&lt;m;<br />
strcpy(l,word);<br />
cout&lt;&lt;&quot;\n Your Last Name is.... \n&quot;;<br />
cout&lt;&lt;l;<br />
}<br />
cout&lt;&lt;&quot;\n&quot;;<br />
getch();<br />
return 0;<br />
}</p>
<p>****************************************************<br />
second program: it ask the user to enter three word and then arranges the word in alphabetical order using string function to solve this.<br />
I do it like this ....</p>
<p>#include&lt;iostream.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
#include&lt;ctype.h&gt;<br />
#include&lt;string.h&gt;<br />
main()<br />
{<br />
int i=1,j,d=0;<br />
char word[10],word1[10],word2[10];</p>
<p>cout&lt;&lt;&quot;Enter How many time you want to do this .... \n&quot;;<br />
cin&gt;&gt;j;<br />
for(i=1;i&lt;=j;i++){<br />
cout&lt;&lt;&quot;\nEnter First Word\n&quot;;<br />
cin&gt;&gt;word;<br />
cout&lt;&lt;&quot;Enter Second Word\n&quot;;<br />
cin&gt;&gt;word1;<br />
cout&lt;&lt;&quot;Enter Third Word\n&quot;;<br />
cin&gt;&gt;word2;</p>
<p>cout&lt;&lt;&quot;\nGiven word is arrenged in alphabetical order\n&quot;;<br />
if(strcmp(word2,word1)&amp;&amp; strcmp(word2,word) ) {<br />
cout &lt;&lt;word2;<br />
cout&lt;&lt;&quot;\n\n&quot;; }<br />
if(strcmp(word1,word)&amp;&amp; strcmp(word1,word2)){<br />
cout &lt;&lt;word1;<br />
cout&lt;&lt;&quot;\n\n&quot;;}<br />
if(strcmp(word,word2)&amp;&amp; strcmp(word,word1)){<br />
cout&lt;&lt;word;}<br />
cout&lt;&lt;&quot;\n&quot;;<br />
cout&lt;&lt;&quot;\t\t ****************** \n&quot;; }<br />
getch();<br />
return 0;<br />
}</p>
<p>*******************************************<br />
Third program: it Suppose to solve this summation series :<br />
1+2 - 3+4 - 5+6 ...... N<br />
I do it like this</p>
<p>#include &lt;stdio.h&gt;<br />
#include &lt;conio.h&gt;<br />
#define N 3</p>
<p>main()<br />
{<br />
int i,j,d=0,s=0; float sum = 0;<br />
for (i=0; i &lt;= N; i++){<br />
sum +=((d-N)-(((d+i)+1)+((s+i)+2));<br />
d=2+i;<br />
s=2+i;<br />
}<br />
printf(&quot;%d: %4.6f\n&quot;, i, sum);<br />
getch();<br />
}</p>
<p>***************************************************<br />
Fourth program : it ask the user to entered two word and exchange the first half a part from word the first string with the second half a part from word the second string also exchange the second half a part from first string with with the first half a part string from the second .</p>
<p>I do it like this</p>
<p>#include&lt;iostream.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;string.h&gt;<br />
main()<br />
{ int i,j;</p>
<p>cout&lt;&lt;&quot;Enter How many time you want to do this a word&quot;;<br />
cin&gt;&gt;j;<br />
for(i=1;i&lt;=j;i++) {<br />
cout&lt;&lt;&quot;\nEnter The Words\n&quot;;<br />
char word1[6],word2[6],tmp[5],tmp1[5];<br />
cin&gt;&gt;word1;<br />
cin&gt;&gt;word2;<br />
cout&lt;&lt;&quot;\nThe first word is &quot;;<br />
cout&lt;&lt;word1;<br />
cout&lt;&lt;&quot;\nThe second word is &quot;;<br />
cout&lt;&lt;word2;<br />
cout&lt;&lt;&quot; \n\n&quot;;<br />
strcpy(tmp1,word2);<br />
strncpy(word2,word1,3);<br />
cout&lt;&lt;&quot;\n&quot;;<br />
cout&lt;&lt;word2;<br />
strcpy(tmp,word2);<br />
strncpy(word1,tmp1,3);<br />
cout&lt;&lt;&quot;\n&quot;;<br />
cout&lt;&lt;&quot; \n\n&quot;;<br />
cout&lt;&lt;word1;<br />
cout&lt;&lt;&quot; \n\n&quot;; }<br />
getch();<br />
}</p>
<p>**************************************************<br />
Fifth program: it Suppose to Generate 9 number and then 0,5<br />
Example( a program Generate 055341122 it will be like this 0505341122 or like this 0555341122</p>
<p>I do it like this</p>
<p>#include&lt;iostream.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
main()<br />
{<br />
int i,j,d=0,k,tmp;<br />
cin&gt;&gt;j;<br />
while(d&lt;j){<br />
for(i=1;i&lt;=9;i++){<br />
k=1+rand()%6;<br />
cout&lt;&lt;k;}<br />
tmp=k;<br />
cout&lt;&lt;tmp;<br />
cout&lt;&lt;&quot;\n&quot;;<br />
d++;<br />
}<br />
getch();<br />
return 0;<br />
}</p>
<p>So help me plzzzzzzzzzzzzzzz<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/182015/need-some-help-in-my-program</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 11:05:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/182015.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 May 2007 11:43:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Need some help in my program on Sun, 20 May 2007 11:43:47 GMT]]></title><description><![CDATA[<p>Hi , Every one I really need some help in my programs it doesn't work as I want I know there something wrong in it if you know where the wrong is jast show me plz as soon as Possible plzzzzz.<br />
I a Beginner in C++ ;</p>
<p>I will be thankful for you .</p>
<p>------------------------<br />
first program : I need the user to enter his/her ful name and then the program separate the string to first name , middle name and the last name which stord in three different strings .<br />
I do it like this ....<br />
#include&lt;iostream.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
#include&lt;ctype.h&gt;<br />
#include&lt;string.h&gt;<br />
main()<br />
{<br />
int i=1,j,d=0,k,tmp,x;<br />
char word[10],f[10],m[10],l[10];</p>
<p>cout&lt;&lt;&quot;Enter Your Full Name\n&quot;;</p>
<p>while(cin&gt;&gt;word){<br />
cout.width('\0');<br />
cout&lt;&lt;&quot;\n&quot;;<br />
if(word!='\0'){<br />
strcpy(f,word);<br />
cout&lt;&lt;&quot;\n Your First Name is.... \n&quot;;<br />
cout&lt;&lt;f; }<br />
strcpy(m,word);<br />
cout&lt;&lt;&quot;\n Your Middle Name is.... \n&quot;;<br />
cout&lt;&lt;m;<br />
strcpy(l,word);<br />
cout&lt;&lt;&quot;\n Your Last Name is.... \n&quot;;<br />
cout&lt;&lt;l;<br />
}<br />
cout&lt;&lt;&quot;\n&quot;;<br />
getch();<br />
return 0;<br />
}</p>
<p>****************************************************<br />
second program: it ask the user to enter three word and then arranges the word in alphabetical order using string function to solve this.<br />
I do it like this ....</p>
<p>#include&lt;iostream.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
#include&lt;ctype.h&gt;<br />
#include&lt;string.h&gt;<br />
main()<br />
{<br />
int i=1,j,d=0;<br />
char word[10],word1[10],word2[10];</p>
<p>cout&lt;&lt;&quot;Enter How many time you want to do this .... \n&quot;;<br />
cin&gt;&gt;j;<br />
for(i=1;i&lt;=j;i++){<br />
cout&lt;&lt;&quot;\nEnter First Word\n&quot;;<br />
cin&gt;&gt;word;<br />
cout&lt;&lt;&quot;Enter Second Word\n&quot;;<br />
cin&gt;&gt;word1;<br />
cout&lt;&lt;&quot;Enter Third Word\n&quot;;<br />
cin&gt;&gt;word2;</p>
<p>cout&lt;&lt;&quot;\nGiven word is arrenged in alphabetical order\n&quot;;<br />
if(strcmp(word2,word1)&amp;&amp; strcmp(word2,word) ) {<br />
cout &lt;&lt;word2;<br />
cout&lt;&lt;&quot;\n\n&quot;; }<br />
if(strcmp(word1,word)&amp;&amp; strcmp(word1,word2)){<br />
cout &lt;&lt;word1;<br />
cout&lt;&lt;&quot;\n\n&quot;;}<br />
if(strcmp(word,word2)&amp;&amp; strcmp(word,word1)){<br />
cout&lt;&lt;word;}<br />
cout&lt;&lt;&quot;\n&quot;;<br />
cout&lt;&lt;&quot;\t\t ****************** \n&quot;; }<br />
getch();<br />
return 0;<br />
}</p>
<p>*******************************************<br />
Third program: it Suppose to solve this summation series :<br />
1+2 - 3+4 - 5+6 ...... N<br />
I do it like this</p>
<p>#include &lt;stdio.h&gt;<br />
#include &lt;conio.h&gt;<br />
#define N 3</p>
<p>main()<br />
{<br />
int i,j,d=0,s=0; float sum = 0;<br />
for (i=0; i &lt;= N; i++){<br />
sum +=((d-N)-(((d+i)+1)+((s+i)+2));<br />
d=2+i;<br />
s=2+i;<br />
}<br />
printf(&quot;%d: %4.6f\n&quot;, i, sum);<br />
getch();<br />
}</p>
<p>***************************************************<br />
Fourth program : it ask the user to entered two word and exchange the first half a part from word the first string with the second half a part from word the second string also exchange the second half a part from first string with with the first half a part string from the second .</p>
<p>I do it like this</p>
<p>#include&lt;iostream.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;string.h&gt;<br />
main()<br />
{ int i,j;</p>
<p>cout&lt;&lt;&quot;Enter How many time you want to do this a word&quot;;<br />
cin&gt;&gt;j;<br />
for(i=1;i&lt;=j;i++) {<br />
cout&lt;&lt;&quot;\nEnter The Words\n&quot;;<br />
char word1[6],word2[6],tmp[5],tmp1[5];<br />
cin&gt;&gt;word1;<br />
cin&gt;&gt;word2;<br />
cout&lt;&lt;&quot;\nThe first word is &quot;;<br />
cout&lt;&lt;word1;<br />
cout&lt;&lt;&quot;\nThe second word is &quot;;<br />
cout&lt;&lt;word2;<br />
cout&lt;&lt;&quot; \n\n&quot;;<br />
strcpy(tmp1,word2);<br />
strncpy(word2,word1,3);<br />
cout&lt;&lt;&quot;\n&quot;;<br />
cout&lt;&lt;word2;<br />
strcpy(tmp,word2);<br />
strncpy(word1,tmp1,3);<br />
cout&lt;&lt;&quot;\n&quot;;<br />
cout&lt;&lt;&quot; \n\n&quot;;<br />
cout&lt;&lt;word1;<br />
cout&lt;&lt;&quot; \n\n&quot;; }<br />
getch();<br />
}</p>
<p>**************************************************<br />
Fifth program: it Suppose to Generate 9 number and then 0,5<br />
Example( a program Generate 055341122 it will be like this 0505341122 or like this 0555341122</p>
<p>I do it like this</p>
<p>#include&lt;iostream.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
main()<br />
{<br />
int i,j,d=0,k,tmp;<br />
cin&gt;&gt;j;<br />
while(d&lt;j){<br />
for(i=1;i&lt;=9;i++){<br />
k=1+rand()%6;<br />
cout&lt;&lt;k;}<br />
tmp=k;<br />
cout&lt;&lt;tmp;<br />
cout&lt;&lt;&quot;\n&quot;;<br />
d++;<br />
}<br />
getch();<br />
return 0;<br />
}</p>
<p>So help me plzzzzzzzzzzzzzzz<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288395</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288395</guid><dc:creator><![CDATA[logieen]]></dc:creator><pubDate>Sun, 20 May 2007 11:43:47 GMT</pubDate></item><item><title><![CDATA[Reply to Need some help in my program on Sun, 20 May 2007 11:47:29 GMT]]></title><description><![CDATA[<p>Hi, several things:</p>
<p>– Where's the question? What's wrong with the codes posted?<br />
– Please (please!) format your source codes by using the buttons below the board input field (and use indentation in your codes, as well).<br />
– On the first glance, your codes are an awful mixture of C and C++ code … you should strive to fix that.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288397</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288397</guid><dc:creator><![CDATA[Konrad Rudolph]]></dc:creator><pubDate>Sun, 20 May 2007 11:47:29 GMT</pubDate></item><item><title><![CDATA[Reply to Need some help in my program on Sun, 20 May 2007 14:00:43 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>There's too much &quot;randomness&quot; in it.</p>
<p>- Copy the source files into a folder.</p>
<p>- Create another folder and try to rewrite the code from what you remember from your first solution strategy <strong>without looking at the first solution</strong>.</p>
<p>- Then compare both versions, try to figure out what you did differently and why, merge them into a third version and then repost what's still unclear.</p>
<p>In fact it imo won't be helpful if somebody gives you perfect solutions with lots of newbie advice; you get this better from a tutorial which you should have handy while coding.</p>
<p>Best Regards</p>
<p>*this</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1288462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1288462</guid><dc:creator><![CDATA[Gast++]]></dc:creator><pubDate>Sun, 20 May 2007 14:00:43 GMT</pubDate></item></channel></rss>