Skip to content

Instantly share code, notes, and snippets.

View ugandapinik's full-sized avatar
👨‍💻
Focusing

Moris John ugandapinik

👨‍💻
Focusing
View GitHub Profile
@ugandapinik
ugandapinik / 0_reuse_code.js
Created January 23, 2016 19:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ugandapinik
ugandapinik / Sum_odd_even.c
Last active July 24, 2016 19:49
C program to find the sum of odd and even numbers from 1 to N
//C program to find the sum of odd and even numbers from 1 to N
#include <stdio.h>
int main() {
int sum_odd = 0;
int sum_even = 0;
int num;
int i;
@ugandapinik
ugandapinik / Pos_Neg.c
Created July 19, 2016 12:19
C program to check whether a given integer is positive or negative
//C program to check whether a given integer is positive or negative
#include <stdio.h>
int main() {
int num;
printf("Enter a number: ");
@ugandapinik
ugandapinik / swap_value.c
Created July 19, 2016 12:32
C program to read two integers M and N and to swap their values.
#include <stdio.h>
//swap function for swaping the value.
void swap(int *ptr1, int *ptr2);
int main() {
int num1, num2;
printf("Enter two number: ");
@ugandapinik
ugandapinik / Equal_Check.c
Created July 19, 2016 12:36
C program to accept two integers and check if they are equal
#include <stdio.h>
int main() {
int m, n;
printf("Enter num1 : ");
scanf("%d", &m);
printf("Enter num2 : ");
scanf("%d", &n);
@ugandapinik
ugandapinik / Decimal_to_Binary.c
Created July 19, 2016 16:31
Decimal To Binary and count number of 1s
#include <stdio.h>
int main() {
int num,
decimal_num,
reminder,
base = 1,
binary = 0,
no_of_1s = 0;
@ugandapinik
ugandapinik / perfect_number.c
Created July 20, 2016 19:54
Pefect Number checking.
#include <stdio.h>
int main() {
int num, rem;
int sum = 0;
int i;
printf("Enter a number: ");
scanf("%d", &num);
@ugandapinik
ugandapinik / Armstrong.c
Created July 20, 2016 20:13
Program to Check whether a given Number is Armstrong
//C Program to Check whether a given Number is Armstrong
#include <math.h>
#include <stdio.h>
int main() {
int rem,
sum = 0,
cube,
temp,
@ugandapinik
ugandapinik / sumation_of_digit.c
Created July 21, 2016 05:48
C program to accept an integer & find the sum of its digits
//C program to accept an integer & find the sum of its digits
#include <stdio.h>
int main() {
int num, digit;
int sum = 0;
int temp;
@ugandapinik
ugandapinik / sumation_of_complex.c
Created July 21, 2016 05:49
Summation of Complex Number
#include <stdio.h>
struct complex {
int real_part,
imaginary_part;
};
int main() {