Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Big Problem!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have tu make a Programm wich transforms bin 2 dec and the other way around.
i show you the Program i got from a friend:
#include <stdio.h>

int eingabe()
{
int a;
printf(&quot;Zahl: &quot;);
scanf(&quot;%d&quot;,&a);
return a;
}

void ausgabe(int z)
{
int i=0;
int s=0;
unsigned int sh=1;
printf(&quot;\n&quot;);
s=8*sizeof(z);
sh <<= s-1;
for (i=1;i<=s;i++) {
if (sh & z)
printf(&quot;1&quot;);
else
printf(&quot;0&quot;);
sh >>= 1;
}
printf(&quot;\n&quot;);
}

int main()
{
int Z;
Z = eingabe();
ausgabe(Z);
return 0;
}
#include <stdio.h>

int eingabe()
{
int a;
printf(&quot;Zahl: &quot;);
scanf(&quot;%d&quot;,&a);
return a;
}

void ausgabe(int z)
{
int i=0;
int s=0;
unsigned int sh=1;
printf(&quot;\n&quot;);
s=8*sizeof(z);
sh <<= s-1;
for (i=1;i<=s;i++) {
if (sh & z)
printf(&quot;1&quot;);
else
printf(&quot;0&quot;);
sh >>= 1;
}
printf(&quot;\n&quot;);
}

int main()
{
int Z;
Z = eingabe();
ausgabe(Z);
return 0;
}


My Problem is that i have to do something that nobody can see that this is not my Program! (They compare each Programm with each other!)
Please tell me ow and PLEASE tell it me now because i need the Program in 2 hours! thanks
 
maybe if you change eingabe to ebagnie they wont notice that you havent learned anything...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top