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() | |
{ | |
int size; | |
printf("size: "); | |
scanf("%d", &size); | |
int arr[size]; | |
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() | |
{ | |
int size; | |
printf("Enter size of array: "); | |
scanf("%d", &size); | |
int arr[size]; |
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() | |
{ | |
int size; | |
printf("size: "); | |
scanf("%d", &size); | |
int arr[size]; | |
for(int i = 0; i < size; i++) |
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> | |
void drawLine(int x, int y) | |
{ | |
if(x==0) return; | |
drawLine(x-1, y); | |
printf("%d\t", x*y); | |
} | |
void f(int num) | |
{ |
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 dec2bin(int n) | |
{ | |
if(n/2==0) return n%2; | |
return (n%2) + dec2bin(n/2)*10; | |
} | |
int main(int argc, char const *argv[]) | |
{ | |
printf("%d", dec2bin(5)); |
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
// given width, print diamond | |
#include <stdio.h> | |
void printSpaces(int sp) | |
{ | |
if(sp <= 0) return; | |
printf(" "); | |
return printSpaces(sp-1); | |
} | |
void printStars(int st) |
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> | |
void printSpaces(int spaceIndex) | |
{ | |
if(spaceIndex <= 0) return; | |
printf(" "); | |
return printSpaces(spaceIndex-1); | |
} | |
void printStars(int starIndex) | |
{ |
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> | |
void printSpaces(int spaceIndex) | |
{ | |
if(spaceIndex == 0) return; | |
printf(" "); | |
return printSpaces(spaceIndex-1); | |
} | |
void printStars(int starIndex) | |
{ |
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> | |
void pr(int wid) | |
{ | |
if(wid == 0) | |
{ | |
printf("\n"); | |
return; | |
} | |
printf("* "); |
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 gcd(int big, int small) | |
{ | |
if(big%small==0) return small; | |
return gcd(small, big%small); | |
} | |
int LeastCM(int big, int small) | |
{ |
NewerOlder