Switch to full style
For C/C++ coders discussions and solutions
Post a reply

convert pascal code to c ?

Sat Nov 22, 2008 12:33 am

i ve develop a project in pascal but cant make a conversion to c ....

cpp code
program shfrovalka;
uses crt;
var text:string;
m,k,c,men:integer;
procedure cez(var text:string; var k:integer);
begin
clrscr;
writeln('vvedite isxodniy text ');
write('$~/> ');
read(text);
write('vvedite klu4 shifrovani9 ');
readln(k);
for m:=1 to length(text) do
begin
c:=ord(text[m])+k;
if c>256 then c:=c-256;
text[m]:=chr(c);
end;
end;
procedure desh (var text:string);
begin
writeln('vvedite kluch deshifrovki' );
readln(k);
for m:=1 to length(text) do
begin
c:=ord(text[m])-k;
if c<256 then c:=c+256;
text[m]:=chr(c);
end;
end;
begin
repeat
clrscr;
writeln('1 - shifrovka ');
writeln('2 - deshifrovka ');
writeln('3 - sosto9nie texta ');
readln(men);
case men of
1:cez(text,k);
2:desh(text); U?
3:begin
writeln(text);
readkey;
end;
end;
until men = 0;
end.



Last edited by DrRakha on Mon Jan 28, 2013 1:53 pm, edited 2 times in total.
Reason: title changed .

Re: can anyone convert this pascal code to c ?

Wed Nov 26, 2008 1:24 am

Code:
http://www.garret.ru/ptoc/Readme.htm


Post a reply
  Related Posts  to : convert pascal code to c ?
 pascal triangle     -  
 Java Programming Problem: Pascal's Triangle     -  
 How to Convert WMV to AVI on Mac     -  
 convert string into binary     -  
 Convert String to Date     -  
 convert hexadecimal to decimal     -  
 Convert To Upper Case in C++     -  
 convert timestamp using javascript     -  
 convert lowercase to uppercase     -