Tags » C Program

Armstrong Number

নাম্বার থিওরিতে কত যে মজার মজার নাম্বার আছে …! আজ এমনই একটা মজার নাম্বার নিয়ে আলোচনা করব

আর্মস্ট্রং নাম্বার

আর্মস্ট্রং নাম্বার হল এমন একটি নাম্বার যে নাম্বার এর প্রত্যেকটা আলদা আলাদা নাম্বার ঘনের (cube)যোগফল ওই নাম্বার । একটা সহজ উদাহারন দেই ৩৭১ স্বাভাবিক একটা সংখ্যা । এর প্রত্যেকটা ডিজিটকে আলাদা ঘন করে যোগ করলে কি দারায় 69 more words

C Program

The Power Of Two (more than 2^64)

Problem:-
The range of number is greater than long long int that is greater than 2^64.
Therefore each digit of the number is stored in a character array terminating by backslash zero :P(i.e.  371 more words

Arrays

Lập trình C/C++ hiệu quả hơn với Notepad++ kết hợp command line!

Có lẽ không phải bàn về tính hiệu quả cao của Notepad++ trong việc lập trình rồi nhỉ :3 Không chỉ là công cụ hữu ích cho các “ 1,052 more words

Hướng Dẫn

Euler's totient function

Euler’s totient function (or Euler’s phi function), denoted as φ(n) or ϕ(n), is an arithmetic function that counts the positive integers less than or equal to n that are  275 more words

C Programming

Demonstration of Tree Depth First Traversal

#include<stdio.h>

#include<stdlib.h>

void printpreorder(struct node*);

struct node{

int data;

struct node* left;

struct node* right;

};

struct node *newNode(int item){

struct node *n = (struct node *) malloc(sizeof(struct node));

n->left= NULL;

n->data = item;

n->right =NULL;

return(n);

}

int main()

{

struct node *root = newNode(4);

root->left= newNode(2);

root->right = newNode(6);

root->left->left= newNode(8);

root->right->right= newNode(31);

printpreorder(root);

}

void printpreorder(struct node* node)

{

if(node == NULL)

return;

else

printf("%d",node->data);

printpreorder(node->left);

printpreorder(node->right);

}

void printinorder(struct node* node)

{

if(node == NULL)

return;

else

printpreorder(node->left);

printf("%d",node->data);

printpreorder(node->right);

}

void printpostorder(struct node* node)

{

if(node == NULL)

return;

else

printpreorder(node->left);

printpreorder(node->right);

printf("%d",node->data);

}

C Program

Predict the output of following C programs.

Question 1

#include<stdio.h>

int fun()

{

  static int num =7;

  return num--;

}

int main()

{

  for(fun(); fun(); fun())

  {

    printf("%d ", fun());

  }

  getchar();

  return 0;

}

Output:  5 2

C Questions

Hello Programmer!

I have started this blog to help people who want to code or learning to code using C or C++ Programming language.

I will list  very common program which would be helpful to learn the coding. 128 more words

C