Programming with Passion

Make the best out of everything.

Tuesday, 19 September 2017

Reversing a string without using array or pointer.

This program will reverse a string without using array or pointer (only a character variable)
Before looking at the program try to solve it by yourself.
Hint : Use recursion 

#include<stdio.h>
char ch()
{
    char c;
    c=getchar();
    if(c==EOF)return 'a';

    ch();

    printf("%c",c);

}

void main()
{
    ch();
}

Happy Coding. :)

Thursday, 17 August 2017

Program to Find roots using Bisection Method

Program to Find roots using Bisection Method

 

// Bisection Method

#include<stdio.h>
#include<math.h>
#define f(a,b,c,x)  (a*x*x)+(b*x)+c
using namespace std;
int main()
    {
    int a,b,c,i,j;
    float z,n,x,y,x1,x2,m;
    printf("Enter the values of a,b and c\n");
    scanf("%d%d%d",&a,&b,&c);
    printf("Enter the range where you can find the roots\n");
    scanf("%f%f",&x1,&x2);
//x=(a*x1*x1)+(b*x1)+c;
    x=f(a,b,c,x1);
//y=(a*x2*x2)+(b*x2)+c;
    y=f(a,b,c,x2);
    n=20;
    if(x*y>=0)
        printf("No roots b/w them\n Exiting...");
    else
        {
        while(n--)
        {
        m=(x1+x2)/2;
//z=(a*m*m)+(b*m)+c;
        z=f(a,b,c,m);
//x=(a*x1*x1)+(b*x1)+c;
        x=f(a,b,c,x1);
//y=(a*x2*x2)+(b*x2)+c;
        y=f(a,b,c,x2);
        if(z*x<0)
            x2=m;
       else if(z*y<0)
            x1=m;

        }
    printf("\nRoot is %f",m);
    }
    return 0;
}
HAPPY CODING :)

Sunday, 13 August 2017

C program to calculate no. of significant digits and rounding off the number if it is a floating number

C program to calculate no. of significant digits and rounding off the number if it is a floating number

 


#include<stdio.h>
#include<string.h>
using namespace std;

int main()
{
char s[200];
scanf("%s",&s);
int l,i,j,n,d,c=0;
l=strlen(s);
for(i=l-1;i>=0;--i)
    {
    if(s[i]!='0')break;
    }
j=i;
for(i=0;s[i]!='.';++i)
    {
    if(s[i]!='0')break;
    --j;
    }
for(i=0;i<l;++i)
    if(s[i]=='.')
        c=1;
if(!c)
    {
    ++j;
    printf("Number of significant digits are %d",j);
    goto end;
    }
printf("Number of significant digits are %d \n How many Significant Digits you want(Should not be less than decimal place)?\n",j);

scanf("%d",&n);
d=j-n;
for(i=l-1;i>=0;--i)
    if(s[i]!='0')
        break;
    else
        s[i]='-';

while(d--)
    {
    if(s[i]=='.')
        {
        s[i]='-';
        continue;
        }
    else if(s[i]>'5')
        {
        s[i-1]=char(int(s[i-1])+1);
       s[i]='-';
        }
else if(s[i]<'5')
    {
    s[i]='-';
    }
else if(s[i]=='5')
    {
    if((int(s[i-1]))%2)
        {
        s[i]='-';
        }
    else
        {
       s[i-1]=char(int(s[i-1])+1);
       s[i]='-';
        }
    }
--i;
    }
for(i=0;i<l;++i)
    if(s[i]!='-')
        printf("%c",s[i]);
end:
return 0;
}

Monday, 17 July 2017

Using Google to Gather Information

Using Google to Gather Information



A hacker may also do a Google search or a Yahoo! People search to locate information

about employees or the organization itself.

The Google search engine can be used in creative ways to perform information gathering. The use of the Google search engine to retrieve information has been termed Google

hacking. Go to http://groups.google.com to search the Google newsgroups. The following commands can be used to have the Google search engine gather target information:

site Searches a specific website or domain. Supply the website you want to search after

the colon.

filetype Searches only within the text of a particular type of file. Supply the file type you

want to search after the colon. Don’t include a period before the file extension.

link Searches within hyperlinks for a search term and identifies linked pages.

cache Identifies the version of a web page. Supply the URL of the site after the colon.

intitle Searches for a term within the title of a document.

inurl Searches only within the URL (web address) of a document. The search term must

follow the colon.

For example, a hacker could use the following command to locate certain types of vulnerable web applications:

INURL:[“parameter=”] with FILETYPE:[ext] and INURL:[scriptname]

Or a hacker could use the search string intitle: “BorderManager information alert”

to look for Novell BorderManager proxy/firewall servers.


COPIED

Saturday, 15 July 2017

Android Device Manager

ANDROID DEVICE MANAGER

1. What would you do if you lose your android smartphone. If you lost it in the house you probably gonna ring it and see where it is but what would you do if it is silent?

2. What would you do if your android smartphone is stolen. Probably want to erase all the Stuffs in it and lock it so no one can use it. But HOW?

3. What if you forget your password and can't seem to remember even the backup pin. What in the hell would you do?

Well I am just here to tell you What you are going to do. 

Ever thought why android smartphones asks for your email address when the first time you switch on it? No okay Most of you didn't but eh its okay you'll get to know today why.

Google offers you one of the great service known as Android Device Manager

So if you lose your smartphone just google android device manager sign in with the email account associated with your smartphone and check it out it gives you the following-

1. Your smartphone last location (last time it was connected to the internet)
2. Option to lock the phone (It deletes every lock and set its own which can't be cracked and also displays a message For e.g. you can Type Call 999999 )
3. Ring option which enables it ringing so you can find it if its nearby.(Even in Silent mode)
4. Erase. Now this must be your last option if you know your mobile got stolen and there is no way to recover it you should go with this option which will erase everything in your smartphone (and i mean EVERYTHING)

Hope you won't need it but just in case :p

Happy Cracking.

Friday, 14 July 2017

WINDOWS PASSWORD RESETTING

HOW TO RESET WINDOWS PASSWORD


 
FOLLOW THESE STEPS TO RESET PASSWORD
1. GET A BOOTABLE WINDOWS PENDRIVE OR DVD/CD 
2. Boot using it and go to repair and explore the computer using it.
3. Goto C:/windows/system32
4. Search for SETHC rename it to anything for backup.
5. Search for CMD make a copy of cmd and rename the copy to SETHC.
6. You are all set here. REBOOT.
7. Now at the LOCKED SCREEN hit shift key 5 times.Sticky Keys will do the work and command prompt will be opened. MAGIC :p
8. Type in "net user" to see the current users. (Of course without quotes)
9. Now "net user USER *" to change the password of USER. (CHANGE USER with the account name you have )
10. Type whatever password you want to set.
You're all done.

HAPPY CRACKING.
#EDUCATIONAL_PURPOSE_ONLY

Monday, 12 June 2017

Crack Pattern or Maze lock in Android Smartphones (Root Users)

Crack Pattern or Maze lock in Android Smartphones (Root Users)


1.Reboot your phone in recovery mode ( Pressing power + Home + volume up)
2. You might want to change the Language in the first screen you see.
3.Go to ADVANCED
4.Then File Manager
5. Navigate to data/system/
6.Look for gesture.key. And just rename it or delete it whatever.
7. Reboot your phone and open it with any pattern.
You're all done.