Skip to content

Instantly share code, notes, and snippets.

View ahmedeshaan's full-sized avatar

Ahmed Eshaan ahmedeshaan

View GitHub Profile
# For loop
for num in 1..10
for new_num in 1..num
print new_num
end
puts "\n"
end
#include <stdio.h>
#include <stdlib.h>
int main()
{
int bin = 0;
printf("Please Enter your positive binary number:");
<?xml version="1.0" encoding="utf-8"?>
<!--
@package gallery
@copyright Copyright (c)2013 Nicholas K. Dionysopoulos / AkeebaBackup.com
@license GNU General Public License version 2 or later
Category Signle view form file
-->
<form validate="true" serverside_validate="true">
<fieldset name="basic_information"
<?xml version="1.0" encoding="utf-8"?>
<!--
@package Gallery
@copyright Copyright (c)2013 Nicholas K. Dionysopoulos / AkeebaBackup.com
@license GNU General Public License version 2 or later
Categories view form file
-->
// Solution for: Take an integer(DECIMAL) input and convert it to Octal
int main()
{
int octal_output[10];
int i=1,j,n=-264;
// To avoid Negative Input
if(n<0) {
n = n +(-n*2);
}
// Question: Take an integer(DECIMAL) input and convert it to Binary number
int main()
{
int binary_output[10];
int i=1,j,n=-52;
// To avoid Negative Input
if(n<0) {
n = n +(-n*2);
}
#include <stdio.h>
#include <stdlib.h>
int multiplcation=1;
void power (int x, int n) {
if(n<0) {
n = n +(-n*2);
}
multiplcation *= x;
printf("%d \n",multiplcation);
<?xml version="1.0" encoding="utf-8"?>
<!--
@package gallery
@copyright Copyright (c)2013 Nicholas K. Dionysopoulos / AkeebaBackup.com
@license GNU General Public License version 2 or later
Items view form file
-->
<form validate="true" serverside_validate="true">
<fieldset name="basic_information"
<?xml version="1.0" encoding="utf-8"?>
<!--
@package Gallery
@copyright Copyright (c)2013 Nicholas K. Dionysopoulos / AkeebaBackup.com
@license GNU General Public License version 2 or later
Items view form file
-->
<form
type="browse"