Posts Tagged ‘C Program’

C Program to Find Smallest and Largest Integer Among 5 Integer Values Using Array

November 13, 2010

↑ Vote This Article

C Program to Find Smallest and Largest Integer Among 5 Integer Values Using Array (more…)

C Program for Base Conversion from Binary to Decimal

November 13, 2010

↑ Vote This Article

The binary (base twonumeral system has two possible values, often represented as 0 or 1, for each place-value. In contrast, the decimal (base tennumeral system has ten possible values (0,1,2,3,4,5,6,7,8, or 9) for each place-value.

To avoid confusion while using different numeral systems, the base of each individual number may be specified by writing it as a subscript of the number. For example, the binary number 10011100 may be specified as “base two” by writing it as 100111002. The decimal number 156 may be written as 15610 and read as “one hundred fifty-six, base ten”. (more…)

C Program to Convert Digits to its Equivalent Words

November 13, 2010

↑ Vote This Article

the program work till 4 digits of number

suppose the Input is: 1234

then the Output will be:  OneTwoThreeFour (more…)

C Program for Multiplication without Using Multiply Operator *

November 3, 2010

↑ Vote This Article

Here is another program from the series tricky code. Here I am going to show you how we can do Multiplication without using Multiply Operator *. Programs like this you will rarely get anywhere else.

Comment below to express your feeling  and suggest me new idea for more tricky code.

Logic of the code:

First you give a try to think the logic.

Here is the answer,

Let a and b are two variables then c=axb. We take 9 as a and 8 as b then c=72.

In other word we are adding 9, 8 times or adding 9, 8 times,  so simple logic. This is what I converted into programing. (more…)

C Program to Print HELLO without HELLO

October 31, 2010

↑ vote this article

Here is i am starting a new series of programs, where we will do coding in a tricky way..

Here we are going to print HELLO without using any of the later from the HELLO, anywhere in the programing. Just think before proceeding further how we can do this..

Well here is the answer; here we are using ASCII CODE of the character to print HELLO. (more…)

C Program to change the Alphabet to Upper or Lower case

October 19, 2010

To convert Alphabet to Upper or Lower case we need to change the ASCII code of the Alphabet.

ASCII code can be define as the code of a character i.e. integer value of the character.

The codes from 65 to 90 are Uppercase Alphabet, which are A to Z. where A is 65 & so on.

And the codes from 97 to 122 are Lowercase Alphabet, which are a to z. where a is 92 & so on.

Here A is 65 and a is 97, the difference between two is 32. So if I want to convert A to a. I’ll add +32 to the ASCII code, which is converting 65 to 92. Opposite we’ll do to convert a to A which is -32. And this is same for all alphabets, so now you got the logic. (more…)

C Program To print pyramid output

October 18, 2010
to print output like
1
2  3
4  5  6
7  8  9  1

2  3  4  5  6

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,c=1;
clrscr();
for(i=1;i<=5;i++)
{ printf(“\n”);
for(j=1;j<=i;j++)
{
printf(“%4d”,c);
c++;
if(c>9)
{
c=0;
c++;
}
}
}
getch();

}

(more…)

Share Your View

October 4, 2010

———————————————————————————————————————————————————————————–

Guys I need your view, suggestions, comments for mycfiles..

Just write me if you want any program, you want help in any topic. i would love to post your experience about programing so share them with me..

mycfiles is coming with lot of new things, so stay tuned…

Just give your email id below and subscribe for mycfiles, whenever I deliver any new post you will get notifications on your Email…

Subscribe to my C files by Email

———————————————————————————————————————————————————————————–

C program to Print Inverse of a given Number

September 30, 2010

Inversing of a given Number. suppose we gave input 123456 then the output of the program will be 654321.

//C program to print inverse of a given number
#include<stdio.h>
#include<conio.h>
void main()
{
long int n,rn=0,d=0;
clrscr();
printf(“Enter the number\n\n”);
scanf(“%ld”,&n);
while(n>0)
{
d=n%10;
rn=rn*10+d;
n=n/10;
}
printf(“%ld”,rn);
getch();
}
(more…)

c program for to find Prime Number

September 30, 2010
A prime number (or a prime) is a natural number that has exactly two distinct natural number divisors: 1 and itself.
the prime numbers under 100:
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97.
code:
//To Print Prime no. till limit
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,c=1;
clrscr();
printf(“Enter the limit\n\n”);
scanf(“%d”,&n);
while (c<=n)
{
i=2;
while(i<=c)
{
if(c%i==0)
break;
i++;
}
if(i==c)
printf(“\n%d”,c);
c++;
}
getch();
}