Skip to content

Instantly share code, notes, and snippets.

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

Jewel Shamim wohhie

👨‍💻
Focusing
View GitHub Profile
@wohhie
wohhie / malloc_example
Created October 15, 2016 04:02
Use of malloc, malloc example * random string generator * malloc, free, random
/*malloc example
* random string generator
* malloc, free, random
*/
#include <iostream>
using namespace std;
int main() {
@wohhie
wohhie / array_sum_using_pointer.c
Last active October 15, 2016 04:55
This C Program calculates the sum of array elements using pointer. The program uses the pointer to traverse the array and adds up the element values there. Here is source code of the C program to calculates the sum of array elements using pointer. The C program is successfully compiled and run on a Linux system. The program output is also shown …
#include <stdio.h>
#include <malloc.h>
int main() {
int i, n, sum = 0;
int *ptr;
printf("enter the size of the array: ");
@wohhie
wohhie / find_sum_with_pointer.c
Created October 15, 2016 05:17
* C program to find the sum of two one-dimensional arrays using * Dynamic Memory Allocation
/*
* C program to find the sum of two one-dimensional arrays using
* Dynamic Memory Allocation
*/
#include <iostream>
using namespace std;
int main() {
@wohhie
wohhie / palindrom_recursion.c
Last active October 18, 2016 01:43
C program to read a string and check if it's a palindrome, without using library functions. Display the result.
/*
* C Program to Check whether a given String is Palindrome or not
* using Recursion
*/
#include <stdio.h>
#include <string.h>
void check(char[], int);
@wohhie
wohhie / concat.c
Created October 18, 2016 02:25
concatenation to string
/*
contcat to string.
*/
#include <stdio.h>
#include <string.h>
int main() {
char string1[20],
string2[20];
int i, j;
numbers = [12,4,45,3,6]
even = []
odd = []
while(len(number) > 0) :
number = numbers.pop()
if(number % 2 == 0 ) :
even.append(number)
else:
odd.append(number)
@wohhie
wohhie / windowAndButton.py
Created December 23, 2016 11:23
Create a GUI with python tinker
from tkinter import *
class Window(Frame):
def __init__(self, master = None):
Frame.__init__(self, master)
self.master = master
self.init_window()
@wohhie
wohhie / ButtonClickEevent.py
Created December 23, 2016 11:52
Button Event Execute
from tkinter import *
class Window(Frame):
def __init__(self, master = None):
Frame.__init__(self, master)
self.master = master
self.init_window()
@wohhie
wohhie / user.rb
Created December 29, 2016 11:13
take user information and display.
print "What's your first name?"
first_name = gets.chomp
first_name.capitalize!
print "What's your last name?"
last_name = gets.chomp
last_name.capitalize!
print "What city are you from?"
city = gets.chomp
@wohhie
wohhie / gradeEx.rb
Created December 29, 2016 23:29
#Exercise Grade
=begin
Simple Grade exercise
=end
print "Enter your marks: "
grade = Integer(gets.chomp)
case grade
when 90..100
letter_grade = "A"