Assgn-V SP
Assgn-V SP
./a.out >result.txt
Otherwise you may use the redirection for the standard input file,
such as,
./a.out <input.txt
For both reading from a file and writing to a file use the following.
If you execute the program multiple times, you may concatenate the
outputs in a single file by using the following redirection command:
./a.out >>result.txt
or
Write a main program which reads N (to be read) real numbers, and prints
the sums of their whole number parts and fractional parts.
Run your program for the following input data set and provide the results with
input datasets in a separate output file.
(i) N=3
(ii) N=6
(iii) N=1
4.356
It processes each character of s1 one by one from left to right and also reads
the digits of the number K from right to left and cyclically shift the character
following the alphabetic order of the English language by the corresponding
digits. If all the digits of the encryption key are exhausted, the process
continues to encrypt the successive alphabets from the unit position of the
digit.
For example, given an input string “Lazy” and encryption key “56”, the
encrypted string will be “Rffe”.
Write also another function decrypt(.), which takes encrypted string s1 and
the key (a positive number) as inputs, and gets back the original string in
s2, which is also passed as a parameter to the function.
For example, given the input string “Rffe” in s1 and the key “56”, the
function would get the string “Lazy” in s2.
Write a main program which reads an English sentence and an encryption key.
The program prints its encrypted string by applying the function encrypt(.) to
each of its words. The program also gets back the original string from the
encrypted string by applying the function decrypt(.) with the same key.
Run your program for the following input data set, and provide the results with
input datasets in a separate output file.
(i) Where the mind is without fear, and the head is held high!
(iii) Jack and Jill went up the hill to fetch a pail of water.