This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ShashiKant@Macbook ~/Dev/posts (master) | |
[64] git status -s | |
?? a | |
?? b | |
ShashiKant@Macbook ~/Dev/posts (master) | |
[66] git status -v | |
On branch master | |
Untracked files: | |
(use "git add <file>..." to include in what will be committed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author: Shashi Kant | |
* code for finding the prime factorization of a given integer. | |
*/ | |
#include<iostream> | |
#include<cmath> | |
using namespace std; | |
int main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Finding power of a number (n ^ p) in O(log(n)) time. | |
// Author: Shashi Kant | |
#include<stdio.h> | |
long long int power(int, int); | |
int main() | |
{ | |
int n,p; | |
scanf("%d %d",&n,&p); | |
printf("%lld\n",power(n,p)); | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Code for swapping two integers without using any other (third) variable. | |
Author: Shashi Kant | |
*/ | |
#include<stdio.h> | |
int main() | |
{ | |
int a=2,b=3; | |
printf("before swapping: %d %d\n",a,b); | |
a^=b^=a^=b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This program is for finding the factorial of a number. | |
Author: Shashi Kant | |
*/ | |
#include<stdio.h> | |
int main() | |
{ | |
int a[1000000]; | |
long long unsigned int num,f,z,temp; | |
scanf("%lld",&num); |