I have to creat a program:
1.enter a line of text and convert to ASCII
2.encode the text by adding a random nunber to the ASCII char.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
unsigned int a[80],ran,n=0,t,len=0,asc[80],n1=0,n2=127;
char input[80],ch;
void main(){
scanf("%s",&input); //receive data input
len=strlen(input)
for(int i=0;i<len;i++){
asc[i]=input[i];
asc[i]+=ran;
}
(then print it by for loop)
}
how can i made a different random no. whenever i run it?
and space can't be converted in ASCII when printing while i input a space in text.



LinkBack URL
About LinkBacks



