Skip to content

Instantly share code, notes, and snippets.

View shohan4556's full-sized avatar
πŸ’»
Making things that does not Exists !!

Shohanur Rahaman shohan4556

πŸ’»
Making things that does not Exists !!
View GitHub Profile
@shohan4556
shohan4556 / letter counter
Created September 19, 2014 02:42
letter counter
#include<stdio.h>
int main()
{
char str[100];
int i=0,nl=0;
gets(str); // it takes input with space
while(str[i] !='\0') // null termination character, it marks the the end of string
{
char ch= str[i];
#include<stdio.h>
int main()
{
char str[100];
int i=0,nl=0;
gets(str); // it takes input with space
while(str[i] !='\0') // null termination character, it marks the the end of string
{
char ch= str[i];
$myarray=array(β€œshohan”,”Dhaka”,”city university”,203,30.33,”S”); // declar ed an array which contain flaot, character, integer, and string type value.
<?php
$city=array(β€œdu”=>”Dhaka”,”raj”=>”Rajshahi”,”rang”=>”Rangpur”)
echo $city[β€œdu”]; // print Dhaka
echo $city[0]; print Dhaka
?>
#include <stdio.h>
int main()
{
int i,n,x;
printf("Enter a positive number to check prime");
scanf("%d",&n);
x = sqrt(n);
for(i=2;i<=x;i++)
{
if(n%i==0)
#include<stdio.h>
int main()
{
int i,j;
int long long sum=0;
int const long long num=2000000;
for(i=1;i<=num;i++){
for(j=2;j<i;j++){
if(i%j==0)
break;
#include <stdio.h>
main()
{
long long int i,j,k,n=2000000,sum=2;
int count;
for(i=3;i<n;i++){
count=1; // assume that it is prime
for(j=2;j<=sqrt(i);j++){
if(i%j==0){
count=0; // it is not prime
@shohan4556
shohan4556 / gist:e1b3cabb162a1281198b
Created October 4, 2014 16:12
euler 10 not efficient
#include<stdio.h>
int main()
{
int i,j;
int long long sum=0;
int const long long num=2000000;
for(i=1;i<=num;i++){
for(j=2;j<i;j++){
if(i%j==0)
break;
@shohan4556
shohan4556 / gist:7eeaf1493cf042280d32
Created October 4, 2014 16:28
euler 10 efficient
#include <stdio.h>
main()
{
long long int i,j,k,n=2000000,sum=2;
int count;
for(i=3;i<n;i++){
count=1; // assume that it is prime
for(j=2;j<=sqrt(i);j++){
if(i%j==0){
count=0; // it is not prime
@shohan4556
shohan4556 / euler problem 09
Created October 23, 2014 09:05
euler problem 09
#include <stdio.h> // solved by Md. shohanur Rahaman
int main()
{
int a,b,c,result;
int n,m;
for(n=2; ;n++){
for(m=1;m<n;m++){
a=(n*n)-(m*m);
b=2*n*m;