National Institute of Technology Delhi Department of Computer Science and Engineering
National Institute of Technology Delhi Department of Computer Science and Engineering
National Institute of Technology Delhi Department of Computer Science and Engineering
Submitted By:
Name: Kartik Kumar
Roll No: 181210026
Branch: CSE
Semester: 8th Sem
int main()
int i, len;
len = strlen(str);
OUTPUT:
2. XOR a string with a 127
AIM: Write a program that contains a string (char pointer) with a value \Hello World’. The
program should XOR each character in this string with 127 and display the result.
Code:
#include <bits/stdc++.h>
int main()
int i, len;
len = strlen(str);
Output:
Result:
A bitwise XOR with 127 will invert the 7 low bits of every character resulting in other characters
which may be printable characters or not. That means when we print the characters we will see
"garbage".