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
#include <iostream> | |
#include <string> | |
using namespace std; | |
long ncr(int n,int r) // This function will calculate the value of nCr | |
{ | |
if((r==0)||(n==r)) | |
return 1; | |
else | |
return (ncr(n-1,r-1)+ncr(n-1,r)); |
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
#include<stdio.h> | |
int main() | |
//predict the o/p and give with the reason | |
{ | |
int i=5; | |
int j=6; | |
int k=7; | |
int *ptr=&k; | |
printf("%d\n",*ptr); | |
printf("%d\n",*(ptr++)); |
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
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main() | |
{ | |
int t,n,i,m; | |
cin>>t; | |
while(t--) | |
{ |
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
import java.io.*; | |
import java.util.*; | |
import java.lang.*; | |
public class main1 | |
{ | |
public static void main (String args[]) throws IOException | |
{ | |
Centroid cent = new Centroid(); | |
int ClustNumber; | |
System.out.println(" Enter the number of clusters"); |
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
#include<iostream> | |
#include<cmath> | |
using namespace std; | |
int gcd(int u, int v) | |
{ | |
while ( v != 0) | |
{ | |
int r = u % v; |
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
#include <stdio.h> | |
#include <string.h> | |
int main() | |
{ | |
char* s ; | |
s = "rashmi"; | |
char temp1; | |
int i; | |
int l = strlen(s); |
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
#include <iostream> | |
using namespace std; | |
int nChoosek( unsigned n, unsigned k ) | |
{ | |
if (k > n) | |
return 0; | |
if (k * 2 > n) | |
k = n-k; | |
if (k == 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
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include<string> | |
#include <iostream> | |
#include <algorithm> | |
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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int n; | |
cin>>n; | |
int x1,y1,x2,y2,x3,y3; | |
int min_a = 999999999; |
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
#include <iostream> | |
#include <string> | |
#include <algorithm> | |
#include <cmath> | |
using namespace std; | |
int count_lucky(int); | |
int main() |
OlderNewer