This post consists a big collection of examples of c program. If you have any doublt in the following c program examples you are free to ask.
Frequently asked c programs in interview
8. Write a c program to check given string is palindrome number or not.
7. Write a c program to solve quadratic equation.
8. Write a c program to print Fibonacci series of given range.
9. Write a c program to get factorial of given number.
1. Write a c program to reverse any number.
2. Write a c program to find out sum of digit of given number.
7. Write a c program to solve quadratic equation.
8. Write a c program to print Fibonacci series of given range.
9. Write a c program to get factorial of given number.
12. Write a c program to generate multiplication table.
13. Write a c program to print ASCII value of all characters.
14. C program to print hello world without using semicolon
15. Write a c program which produces its own source code as its output
C program with numbers13. Write a c program to print ASCII value of all characters.
14. C program to print hello world without using semicolon
15. Write a c program which produces its own source code as its output
1. Write a c program to reverse any number.
2. Write a c program to find out sum of digit of given number.
10. Write a c program to find out NCR factor of given number.
11. How to convert string to int without using library functions in c
12. Program in c to print 1 to 100 without using loop
13. C program for swapping of two numbers
14. Program to find largest of n numbers in c
15. Split number into digits in c programming
16. C program to count number of digits in a number
11. How to convert string to int without using library functions in c
12. Program in c to print 1 to 100 without using loop
13. C program for swapping of two numbers
14. Program to find largest of n numbers in c
15. Split number into digits in c programming
16. C program to count number of digits in a number
L.C.M and H.C.F.
Swapping
Conversion ( Number System )
2. Write a c program to convert decimal number to octal number.
3. Write a c program to convert decimal number to hexadecimal number.
4. Write a c program to convert octal number to binary number.
3. Write a c program to convert decimal number to hexadecimal number.
4. Write a c program to convert octal number to binary number.
6. Write a c program to convert octal number to hexadecimal number.
8. Write a c program to convert hexadecimal number to octal number.
9. Write a c program to convert hexadecimal number to decimal number.
10. Write a c program to convert binary number to octal number.
9. Write a c program to convert hexadecimal number to decimal number.
10. Write a c program to convert binary number to octal number.
12. Write a c program to convert binary number to hexadecimal number.
13. C program for addition of binary numbers .
14. C program for multiplication of two binary numbers.
15. C program fractional binary conversion from decimal.
16. C program for fractional decimal to binary fraction conversion.
17. C program to convert decimal number to roman.
18. C program to convert roman number to decimal number.
19. C program to convert each digits of a number in words
20. C program to convert currency or number in word.
13. C program for addition of binary numbers .
14. C program for multiplication of two binary numbers.
15. C program fractional binary conversion from decimal.
16. C program for fractional decimal to binary fraction conversion.
17. C program to convert decimal number to roman.
18. C program to convert roman number to decimal number.
19. C program to convert each digits of a number in words
20. C program to convert currency or number in word.
Conversion ( Unit )
String
3. Write a c program to delete the all consonants from given string.
9. Write a c program to print the string from given character.
10. Write a c program to reverse a string
11. Reverse a string using recursion in c
12. String concatenation in c without using strcat
13. How to compare two strings in c without using strcmp
14. String copy without using strcpy in c
15. Convert a string to ASCII in c
10. Write a c program to reverse a string
11. Reverse a string using recursion in c
12. String concatenation in c without using strcat
13. How to compare two strings in c without using strcmp
14. String copy without using strcpy in c
15. Convert a string to ASCII in c
Matrix
5. Write a c program to find out transport of a matrix.
6. Write a c program for scalar multiplication of matrix.
7. C program to find inverse of a matrix
8. Lower triangular matrix in c
9. Upper triangular matrix in c
10. Strassen's matrix multiplication program in c
11. C program to find determinant of a matrix
6. Write a c program for scalar multiplication of matrix.
7. C program to find inverse of a matrix
8. Lower triangular matrix in c
9. Upper triangular matrix in c
10. Strassen's matrix multiplication program in c
11. C program to find determinant of a matrix
File
2. Write a c program to delete a file.
3. Write a c program to copy a file from one location to other location.
6. Write a c program which writes string in the file.
9. Write a c program which concatenate two file and write it third file.
10. Write a c program to find out size of any file.
11. Write a c program to know type of file.
12. Write a c program to know permission of any file.
13. Write a c program to know last date of modification of any file.
14. Write a c program to find size and drive of any file.
10. Write a c program to find out size of any file.
11. Write a c program to know type of file.
12. Write a c program to know permission of any file.
13. Write a c program to know last date of modification of any file.
14. Write a c program to find size and drive of any file.
Complex number
3. Write a c program for multiplication of two complex numbers.
4. Write a c program for division two complex numbers.
Series
6. Write a c program to find out the sum of given H.P.
Array
6. Write a c program for insert an element at desired position in an array.
7. C program to find largest and smallest number in an array
7. C program to find largest and smallest number in an array
Sorting
5. Write a c program for heap sort.
7. Write a c program for shell sort.
Recursion
Size of data type
Using pointer
Searching
Area and volume
2. Write a c program to find the area of any triangle.
3. Write a c program to find the area of equilateral triangle.
4. Write a c program to find the area of right angled triangle.
3. Write a c program to find the area of equilateral triangle.
4. Write a c program to find the area of right angled triangle.
6. Write a c program to find the area of trapezium.
7. Write a c program to find the area of rhombus.
8. Write a c program to find the area of parallelogram.
7. Write a c program to find the area of rhombus.
8. Write a c program to find the area of parallelogram.
9. Write a c program to find the volume and surface area of cube.
10. Write a c program to find the volume and surface area of cuboids.
11. Write a c program to find the volume and surface area of cylinder.
10. Write a c program to find the volume and surface area of cuboids.
11. Write a c program to find the volume and surface area of cylinder.
12. Write a c program to find the surface area and volume of a cone.
13. Write a c program to find the volume and surface area of sphere.
13. Write a c program to find the volume and surface area of sphere.
14. Write a c program to find the perimeter of a circle, rectangle and triangle.
C program with very large numbers
1. Write a c program to find factorial of 100 or very large numbers
2. Write a c program to multiply the two very large number (larger the long int)
3. Write a c program for division of large number (larger than long int)
4. C code for modular division of large number.
5. C code for division of large number.
6. C code for power of large numbers.
Other
1. C program for ATM transaction.
C program with very large numbers
1. Write a c program to find factorial of 100 or very large numbers
2. Write a c program to multiply the two very large number (larger the long int)
3. Write a c program for division of large number (larger than long int)
4. C code for modular division of large number.
5. C code for division of large number.
6. C code for power of large numbers.
Other
1. C program for ATM transaction.
7. Write a c program to print the all prime numbers between 1 to 300.
8. Write a c program which passes structure to function.
9. Palindrome in c without using string function
10. How to get the ASCII value of a character in c
11. C program to get last two digits of year
12. C program without main function
8. Write a c program which passes structure to function.
9. Palindrome in c without using string function
10. How to get the ASCII value of a character in c
11. C program to get last two digits of year
12. C program without main function

132 comments:
i suggest that there should be examples on bucket sorting and on the different loops as well as drawing with loops, for example drawing a triangle with stars or numbers.And thank you for the website it is awesome!!
Program to find the size of int without using sizeof operator.
#include
void main()
{
char *ptr1,*ptr2;
int fl;
ptr1 = &fl;
ptr2 = (&fl+1);
printf("%u",ptr2-ptr1);
}
getch();
}
An Excellent website to know what is 'C' and to prove ourselves in c..Exellent really..Amazing..
........by kishore reddy
very good website i am very thankful to provide such a good information about c,please update at some interval of time with new programs.
vry good website it helps me a lot...plz update with new prgms wth their solutions..
really we will be done with c if we can practice this!!really amazing!!god job
this truly a gr88888888 site... actually a confident booster for ppl like me who are a bit scared of prgmming......
love dis site its reallly really awesome.....
it sounds good really helped me a lot...
Thanks for the all the programs. Very helpful
Thanks for helping me>.
its very good site...
/*1. Write a program to convert uppercase characters in a string to lowercase without using string function */
#include
#include
void main()
{
static char a[20];
int i=0;
clrscr();
printf("\n\t*******************************");
printf("\n\tUpper Case To Lower Case String");
printf("\n\t*******************************");
printf("\n\n\tEnter the UPPER case string:");
scanf("%s",&a);
printf("\n\tThe lower case String is:");
while(a[i]!='\0')
{
printf("%c",a[i]+32);
i++;
}
getch();
}
By,
N.Ka_Rthick
/*2. Write a program to convert the two-dimensional array into one-dimensional array */
#include
#include
#define mrow 3
#define mcol 2
main()
{
int a[mrow][mcol],b[mrow*mcol];
int i,j,k=0;
clrscr();
printf("Enter the Matrix elements in row order\n");
for(i=0;i<mrow;i++)
for(j=0;j<mcol;j++)
{
scanf("%d",&a[i][j]);
b[k++]=a[i][j];
}
printf("Given Two_dimensinol arry: \n");
for(i=0;i<mrow;i++)
{
for(j=0;j<mcol;j++)
printf("%d\t",a[i][j]);
printf("\n");
}
printf("Equialent One_Dimenson array \n");
for(i=0;i<mrow*mcol;i++)
printf("%d\t",b[i]);
getch();
return;
}
Output:
Enter the Matrix elements in row order
10 15 20 25 30 35
Given Two_dimensinol arry:
10 15
20 25
30 35
Equialent One_Dimenson array
10 15 20 25 30 35
/* 3.Write a program to calculate the tan series */
#include
#include
int main(void)
{
double x,pi=3.1415926535;
clrscr();
x=tan(pi/4);
printf("\n\t*****TAN SERIES*****");
printf("\n\n\tTan(%f)=%f\n",pi/4,x);
getch();
return;
}
OUTPUT:
*****TAN SERIES*****
Tan(0.785398)=1.000000
Really good one.
Thanks KarthicK to share it.
Thanks a ton to creators & contributors of this blog/website. You guys made me crack my 1st interview !!!! 8) Yeeppiiii!!! Thanks !
Thanks for creating such a wonderful site and helping us....:)
This site is very helpful for beginners and also developers .Thanks.
THIS IS AN EXECELENT SITE OF LEARNER.
anybody suggest me the program for"PROGRAM FOR READ & PRINT CONTAIN OF AN ARRAY FIND FREQUENCY OF EACH VALUE WITHIN AN ARRAY"
Hi Swapnil,
I think this code may help you
#include
int main(){
int MAX =20;
int arr[20] = {1,2,30,4,1,2,6,8,5,0,9,8,3,5,6,7,2,6,1,1};
int frequency[2][20];
int counter = 0;
int flag = 0;
int i =0,j=0,k=0;
int pivot;
for (i=0;i<MAX;i++){
pivot = arr[i];
for (k=0;k<j;k++){
if (pivot == frequency[0][k]){
flag = 1;
break;
}
}
if (flag == 0){
for(k=0;k<MAX;k++){
if(pivot ==arr[k])
counter++;
}
frequency[0][j] = pivot;
frequency[1][j] = counter;
counter = 0;
j++;
}
flag= 0;
}
for(i=0;i<j;i++){
printf("Element : %d, Frequency : %d \n",frequency[0][i],frequency[1][i]);
}
return 0;
}
i found it really helpful to me
hope its going to have some more programmes...so that we can learn more
very good
thanks
plz answer this ques....
wap to print table of any number in the table format
This site is very helpful for me.In this site some programs are not answered.so,please answer those programs.
This really helped me a lot to programs easily................thank u very much
it is really interesting and useful...thank u so much
IMBA Gud re ur all programs help me a lot....Thanks a ton..:D
I need help on implementing assembler and Macro in C. Is there any one to help in this regard
Algorithms are very nice
Add link to heap ,merge, shell and also include fibonacci search algorithm implementation if possible. Really interesting link...
he has given his best simply...we can edit our programs later on what we have learned...rocking work by some guy
Great collections,Thanks...
really awesome site....
excellent site for freshers
Thanks buddy.
really awesome site.... very useful site..
i generaly confused with pointer can u explai the concept of pointer piz......?
THIS IS AWSOM SITE OF PROGRAMMING,...........
WHAT N%10==0 REPRESENTS
HI Friend
anybody help me to write a prog to count the no of char,special symbol in a file by using file handling.
plz help out for this program "write a program to insert a element in an array"
thanks alot.... dis is damn good site.. i have clred lots of my probloems from dis site....
this is awesome,cloud9,top of the world site......
very help full.
thanks
I need a c program for convert a given sentence into the first letter of each word should be upper case remaining are lower case.
really superb website.......
it z very useful ......
really nice to know much abt 'c' .........pls do update even more if possible n mainly in pointers .....
very nice & helpful site . . .
but some programs are with a specified method,example,
some are solved with for loop only & some with while,i needed both methods,although the site is great for learning c programs :-)
thank you.
really suprb and quite useful
program to find the pascals traingle:
double fact(double n)
{
return (n > 1) ? n * fact(n - 1) : 1;
}
double ncr(int n, int r)
{
return fact(n) / (fact(r) * fact(n - r));
}
void main()
{
for (int i = 0; i < 15; i++)
{
for (int j = 0; j <= i; j++)
printf("%d",ncr(i,j));
}
}
its really nice , thanx
thank you soooo much...it is awesome collection of programs..
great machi excellent use for my assignment!!!!!!
i think it was created by that god to escape me for that devil computer professor!!!!:)
Is anybody help me for the "A program for load flow analysis of 5-bus system using Newton-Raphson in C-language or C++.
Is anybody help me for the "A program for load flow analysis of 5-bus system having two generators using Newton-Raphson method in C-language or C++.
very gud website
its really amazing, it will helps a lot ...
thanx a lot.
c program to arrange n number of books in a given box where each and every time .when i want to read the book & i need to pick the book in reverse manner and once completed the reading of book and again place it on same model from begining using STACK OPERATION??
hiii this very gud site where any one can develop c skills
This the world's best site for various types of C questions. It extremely helps to convert us to a genius programmer in C. Thanks "cquestionbank.blogspot.com" for developing this type of site for all students and Programmers.
it's an awsum website..gud...but plzz keep on updating d site...
-kapil agrawal(NIT RAIPUR)
very useful website for all of us who r facing a bit of difficulty wid c programming..thanqq
its a very gud site for c learner
very Good Good site,I Like it .Tanks
Please answer
C++ program that continuously calculates the number of
characters existing between the two characters
can anyone help me to write this program the program is deleting a string from the text. in c language.
gr8 source of information.
Thanks a lot!!
deals with so many examples...
cant find this in any other site
thanks a lot to it's creators thank u so much
awesome site
i want a program to take input of roll no. & marks of a 5 student & calculate the total & percentage, & display the output in table format
really a good and purposeful , valuable, knowledgeable website for clearing all fundamentals in c
Hi frnd it is very good site for C Lerning ... It will be more better if some "bit operation" program will be added on this site
thnx
9
7 9
5 7 9
3 5 7 9
1 3 5 7 9
Please help me some one?
plz tell me ans of above pattern prog plz plz
its a really a good site which helps us alot thnks
for it
very nice yaaaarrr,,, thnxxxx.
by prabh
* ******
* *
* *
************
* *
* *
******* *
please send coding
best site for programming
amazing work
gajanand
int count(int n)
{
if(n==0)
return 0;
else
return count(n-2);
}
void main()
{
count(10);
}
CAN ANY ONE GET THE SOLn. plz.
WRITE A PROGRAMME TO INPUT SOME INTEGERS AND FIND OUT HOW MANY AMONG THEM ARE NON PRIME?
ai this program used to find no of occurences of an element in array
can anyone say whether this is efficient program or not?
#include
#include
main()
{
int i,no,count=0,search,a[10];
printf("enter the no of elements want to store in array\n");
scanf("%d",&no);
for(i=0;i<no;i++)
{
scanf("%d",&a[i]);
}
printf("ARRAY ELEMENTS HAS BEEN STORED\n");
printf("enter the element how many times stored in array\n");
scanf("%d",&search);
for(i=0;i<no;i++)
{
if(a[i]==search)
{
count++;
}
}
if(count!=0){
printf("ur no has occured %dtimes in array",count);
}
if(count==0)
{printf("not found");
}
getch();
}
its very nice......................
i need a program for exponencial calculation without using math function.........
good work
Really a good site to know each and every thing about c programming.... So much useful to me... Thanks a lot ADMIN(S)....
Your's BASHA...
realay a nice site . very helpful.
really nice....i lvd dis site...dis z very much useful 4 beginners lik me...thanxxx
can aybody plzzzzz tell me how to print sin series??
Programs are very nice and helpful to freshers.can u send a program on string that is substring or not of other without standard function
it helped me a lot a lot........... thanks............
ReAlLy GoOd ColLEcTiOn oF pRoGrAm....Itzz VrY hElPfUlL fOr mE...
how right a fibonacci series program width out Initialization 0 and 1 in c language
how to calculate holiday budget using c program?
please help me...my friend need this...
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE. ????
send it to rjpt.srinu497@gmail.com
its very useful..helping a lot
int main()
{
int t=9,n=5,i,j,flag=0;
clrscr();
for(i=1;i<=n;t=9-i*2,flag=1,i++)
{
for(j=0;j<i;j++)
{
printf("%d ",t);
if(flag)
{
t=t+2;
}//if
}//for1
printf("\n");
}//for2
getch();
return 0;
}//main()
o/p-
9
7 9
5 7 9
3 5 7 9
1 3 5 7 9
Can we assign NULL value to the Integer variable?
IF yes then Prove and inform me????
nice blog !
please can someone write this program for me......its a project whc z givn me difficulty....
write a program for a car sale.You have to provide 4 basic functionalities.These are ;
1-add (adding a new car)
2-List (Listing existing cars )
3-Update (Update a car info)
4-Search (Search for a car)
DETAILS: Maximum capasity that can be stored at garage is 500. A car has following properties
Example :
1. license plate
2. Fabrication year
3. Make
4. Model
5. Price
6. color
1. 34ABC51
2. 2000
3. Audi
4. A3
5. 10 000$
6. red
Males:Audi,Bmw,Ford,Kia,Nissan,Opel,Toyota
Check for related models from internet and include them on your project , 4 models
are enugh for each Male.
Colors:Red,Green,Blue,Orange,Yellow,Pink,Violet,Magenta,White,Black
Functionalities:
Provide a menu for user that can choose an operation (add,list,search,update,exit)
1-Adding a new car :
When user select add , display a list of existing males automaticly(Ex:
1:audi,2:Bmw...) , suppose user entered 1(Audi).Then list existing models (Ex.
1:A3,2:A4...) , after user chosed model ,display color list and then read other
paramaters from user.
2-Listing car list:
Listing output should look like ;
AUDI’ES
Model Count
A3 5
A4 7
A6 8
Total : 20
And same for other Males.
3-Searching car int the list:
You will implment searching operation related to the price.Read min and max values
from list and display all cars from this list which prices are between min and max values.
A sample output could look like :
Suppose user entered 5000 for min and 25000 for max ,
Number of cars found 2
Male model Year Licence
plate
Price Color
Audi
Wolkwagen
A3
Golf
2000
2004
34ABC51
34AAA11
17000
18000
Red
White
it is very usefull,nice blogspot
1.Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
Please send it my id -gkgunjanverma@yahoo.com
#include
int main()
{
int i,j;
i=5;
j=++i + ++i + ++i + ++i;
printf("%d\n%d",j,i);
}/// plz explain the output..........
It is one of the excellent website so that even the begineer in the c language can improve his/her skills in writing various programs in it and it is very helpful to every one.
Fantastic
to find the Modulus of the Given Number
Really very usefull
A great tanz
#include
#include
int main()
{
int i,j,k;
i=5;
j=10;
k=i+++++j;
system("cls");
printf("%d\n",k);
getch();
return 0;
}
what is wrong with k=i+++++j;
please tell me rules for defining such type of expression.
this is AMAZING website. Thanks for providing knowledge of c on this website. really thankful 2 you.
please help i want a progam to print all combinations of a four digit number
the best website i have ever seen in my life...
this site is really helpful for me
int main()
{
int i;
char *c="13579";
for(i=0;i<5;i++)
printf("%*.*s\n",i+1,i+1,c+4-i);
getch();
}
By prem baboo
suprab programs.........
please someone write me a program to reverse the words in a sentence....
Too great....
You rocks
super website
#include
#include
void main()
{
clrscr();
int x[10],i;
for(i=0; i<10; i++)
{
cout<<"Enter the "<<(i+1)<<" integer : ";
cin>>x[i];
}
for(i=0; i<1-; i++)
{
int y=x[i],c=0;
for(j=1; j<=y; j++)
if(y%j==0)
c=c+1;
if(c==2)
cout<<"your prime number is :"<<y;
else
Cout<<"your not prime number is : "<<y;
}
getch();
}
Please someone write a program to open Notepad infinite times after started the window
really, these program collections helped me a lot.....thank u.
k=i+++++j; //because here increment operator work , if u define such type of expression compiler can't understood and work on increment operator ,gives "compile time error" like require value not increment or somthng.
k=i++ + ++j; // true
j=++i + ++i + ++i + ++i;//both are pre increment,so value is assigned after increment of original value
j= 6 + 7 + 8 + 9; //increment and then assigned the value in j
output:
j=31
i=9
the programs are so easily arranged i found any type of program easily Keep it dude ..
your c program example is great as it list all program hope u may improve the list..
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
Please send it my id -kundanditdehradun@gmail.com
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
send this to anunov1990@gmail.com.myy friend need this
i think the correct answer is j=36
write down the conditional statement for:count less than or equal to 100 and character not equal to "*".can anyone please tell me the answer.
hi...I have a string "I am a good boy".I want to print first "boy" then "am" then "I" then "a".plz tell me how I do this by pointer.
#include
int main()
{
int t=9,i=1;
while(t>0)
{
while(t!=9)
{
printf("%d",t);
t=t+2;
}
printf("%d \n",t);
t=t-2*i;
i++;
}
return 0;
}
o/p
9
79
579
3579
13579
write a program to find the sum of this series upto n terms-
1+1/2+1/4+1/9+1/16+..........
can some one do this progrm
wap to make a structure named student with studnt name, roll no and total marks as its elements. sort the data in accending order acoording to highest marks and in alpaha betical order also
a[23456],b[13456] are two large integer arrays.now write a c program to compare a,b whether "a==b"
&c=a+b,d=a-b,c[i]=(carry)+(a[i]+b[i])-10;
can one suggest on this program.
can anyone suggest,how to remove all elements whose value is >20
hi all, can one provide me c code for displaying global time zone using SQL connection........?????
Post a Comment