Posts

Anonymity, privacy and security

 Introduction: 1. Privacy: - State in which one is not being observed by others 2. Anonymity: - State where acting person name is unknown  (Note:- To be private on internet it is very difficult because we are using the resources that are created by others. So it is impossible to be private.) Our all activities are visible to: 1. Employees 2. Hackers 3. Government Agencies So the best solution for this is to be as anonymous as possible. So if anybody manage to intercept our data they wont be able to link it to ourselves or to our identity. To improve privacy and anonymity, we need two things: 1. Anonymizing service 2. Private online service You cannot be private and anonymous without being secure because instead of using best anonymous server, best VPN, private service and so on, if the attacker manage to hack you device then all these things are useless. - All the website like Facebook, google, twitter and so on can trace or can view your each and every details. They can also ...

Union in C

 1. Write a C program to find the size of total memory allocated when using union. #include<stdio.h> union emp {     int id;     char name[10];     char address[15]; }; int main() {     union emp e;     printf("The maximum size of data is %d",sizeof(union emp));     return 0; }

Array of Structure

 1. Write a program to display value of 5 students using array of structure. #include<stdio.h> #include<string.h> struct student {     int id;     char name[20];     char add[20]; }; int main() {     int i;     struct student st[5];     for (i=1;i<=5;i++)     {         printf("Enter the id?");         scanf("%d",&st[i].id);         printf("Enter the name?");         scanf("%s",&st[i].name);         printf("Enter the address?");         scanf("%s",&st[i].add);     }     printf("List of data");     for(i=0;i<=5;i++)     {         printf("Roll no %d is %s whose address is %s \n",st[i].id,st[i].name,st[i].add);     }     return 0; }

Structure example

 1. Write a c program to display name and price of car using structure. #include<stdio.h> int main() {     struct car     {         char name[20];         int price     };     struct car c1={"Lambo",2000};     printf("The name of car is %s \n",c1.name);     printf("The price of car is %d",c1.price);     return 0; } or #include<stdio.h> struct car     {         char name[20];         int price;     }c1; int main() {     strcpy(c1.name,"lambo"); // copying string in char array     c1.price=12345;     printf("The name of car is %s",c1.name);     printf("The price of car is %d",c1.price);     return 0; } structure example with asking input from user #include<stdio.h> int main() {     struct emp     {         char...

Recursion example

  1. C Program to find the factorial of given number. #include<stdio.h> #include<conio.h> int main() {     int i,f=1,n;     printf("Enter the factorial number.");     scanf("%d",&n);     for(i=1;i<=n;i++)     {         f=f*i;     }     printf("The factorial of %d is %d",n,f);     return 0; } 2. C Program to find the factorial using recursion. #include<stdio.h> #include<conio.h> int fact(int n); int main() {     int x,f;     printf("Enter the number whose factorial you want to find?");     scanf("%d",&x);     f=fact(x);     printf("The factorial of %d is %d",x,f);     return 0; } int fact(int n) {     if(n==1)     {         return 1;     }     else if(n==0)     {         return 0;     }  ...
 1. C Program to find the factorial of given number. #include<stdio.h> #include<conio.h> int main() {     int i,f=1,n;     printf("Enter the factorial number.");     scanf("%d",&n);     for(i=1;i<=n;i++)     {         f=f*i;     }     printf("The factorial of %d is %d",n,f);     return 0; }