0% found this document useful (0 votes)
64 views

C/C++ Programs: Home About Contact Blog Templates

This blog discusses various C and C++ programming concepts and examples. It includes programs for defining and accessing structures, string manipulation using pointers, declaring arrays of pointers, using functions to find factorials and the product of two numbers, recursion to find factorials, and more. The blog is intended for students learning C/C++ programming.

Uploaded by

Anurag Sarkar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

C/C++ Programs: Home About Contact Blog Templates

This blog discusses various C and C++ programming concepts and examples. It includes programs for defining and accessing structures, string manipulation using pointers, declaring arrays of pointers, using functions to find factorials and the product of two numbers, recursion to find factorials, and more. The blog is intended for students learning C/C++ programming.

Uploaded by

Anurag Sarkar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Home About Contact Blog Templates

c/c++ programs
This blog is for all the students of Engineering.

Find out what I'm doing, Follow Me :)


Type your

This Blog Linked From Here The Web This Blog

Linked From Here

The Web

Basic c programs Data stucture C++

Sunday, February 28, 2010


Program to define structure book.
stuct book { char title[20]; char author[20]; int price; }; void amin() { struct book b; clrscr(); printf("Enter the title of the book"); scanf("%s",b.title); printf("\nEnter the author of the book\t"); scanf("%s,b.author); printf("\nEnter the price of book\t"); scanf("5d",&b.price); printf("\nThe details are\n"); printf("Title\\tAuthor\tPrice\n"); printf("%s\t%s\t%d",b.title,b.author,b.price); getch(); } Posted by Tech guru at 11:40 PM 0 comments Labels: c program+function and stucture

Program reverse of given string using pointer.


use header file as string.h void main() { char str[20],rev[20]; int i,l,j; char *p; clrscr(); printf("Enter the string\t"); scanf("%s",str); p=str; l=strlen(str); p=p+l; for(i=l;j=0;i>=0;i--;j++)

{ rev[j]=str[i]; } rev[j]='\0'; printf("\nThe reverse is %s,rev); getch(); } Posted by Tech guru at 11:27 PM 0 comments Labels: c program for pointer

Program to declare array of pointer and address the element to other array.
void main() { int a[10],b[10],c[10],d[10],e[10]; int *p[5]; int i; clrscr(); p[0]=a; p[1]=b; p[2]=c; p[3]=d; p[4]=e; printf("\nThe address of 5 array are\n"); for(i=0;i<5;i++) { printf("The address of array %d is %u\n",i+1,p[i]); } getch(); } Posted by Tech guru at 11:23 PM 0 comments

Tuesday, February 23, 2010


Function to find product of two variables.
int product(int,int); void main() { int a,b,c; printf("Enter the two number"); scanf("%d %d",&a,&b); c=product+(a,b); printf("The product is %d",c); getch();

} int product(int x,int y) { int z; z=x*y; return(z); } Posted by Tech guru at 5:36 AM 1 comments Labels: c program+function and stucture+product of two variables

Program to find factorial of no using function.


float factorial(int); void main() { int n; float f; printf("Enter a no"); scanf("%d",&n); f=factorial=%f",f); getch(); } float factorial (int x) { float f=1; while(x>0) { f=f*x; x--; } return(f); } Posted by Tech guru at 5:31 AM 0 comments Labels: c program+function and stucture

Program using a recursive function to find factorial of no.


float fact(int); void main() { int n; float f; printf("Enter the no"); scanf("%d",&n); f=fact(n); printf("Factorial=%f",f);

getch(); } float fact(int x) { float f1; if(x==1_ { return; } else { f1=x*fact(x--); } return(f1); } Posted by Tech guru at 5:24 AM 0 comments Labels: c program+recursion+factorial

Program using pointer to accept an integer & print it in reverse order.


void main() { int a[100].n.i; int *p;clrscr(); printf("Enter the size of array"); scanf("%d",&n) printf("Enter the element of array"); for(i=0;i { scanf("%d",&a[i]); } p=a;p=p+(n-1); for(i=(n-1);i>=0;i--)

{ printf("%d",*p); p--; } getch(); } Posted by Tech guru at 5:10 AM 0 comments Labels: c program for pointer Older Posts Subscribe to: Posts (Atom)

Followers

Search This Blog


Search

powered by

Labels

Armstrong no (1) array and strings (5) basic c program (1) c program for pointer (2) c program+function and stucture (2) c program+function and stucture+product of two variables (1) c program+recursion+factorial (1) c program+string handling function (3) c program+swap using pointer (1) palindrome program (1) switch case (1)

Blog Archive

2010 (20) o February (16) Program to define structure book. Program reverse of given string using pointer. Program to declare array of pointer and address th... Function to find product of two variables. Program to find factorial of no using function. Program using a recursive function to find factori... Program using pointer to accept an integer & print... Program to swap the value of two integer using poi... Program a number wheather palindrom or not Program to continicat 2 strings without using stin... Find the length of string without using sting hand... Program to add 2 Marices Ascending order of array. Program to find smallest and largest element from ... Program to add two array. Program to accept 10 nos from the user,store in ar... o January (4) Menu driven program.(switch case). Program to display Palindrome number. Program to display Armstrong number. Program to display reverse number.

About This Blog


This blog is for all the students of Diploma and Degree and also for pepole who are interested in c/c++ programing. Apple Google Microsoft iPad for Movies? Call My Chiropractor PC World - Mar 06, 2010 - Mar 06, 2010 Apple is pitching its new iPad tablet as a multi-use consumer device, a superior alternative to clunky netbooks and laptops. Admittedly, the device does ... Related Articles clipped from Google - 3/2010 Juggernaut effect: Apple Valley, Simley roll to wrestling titles Minneapolis Star Tribune - Mar 07, 2010

- 14 hours ago Apple Valley continued its domination of Class 3A, and Simley mopped up cleanly 2A. By JOHN MILLEA, Star Tribune On a day of celebration and domination, ... Related Articles clipped from Google - 3/2010 Mom, Apple Pie and Mortgages New York Times - Mar 06, 2010 - Mar 06, 2010 By ROBERT J. SHILLER FOR decades, the federal government has subsidized housing particularly owner-occupied housing. This has been especially true during ... clipped from Google - 3/2010 Apple's iPad: Will it sell? Computerworld - Mar 07, 2010 - 15 hours ago By Gregg Keizer Computerworld - Apple's iPad will fly out of stores when it goes on sale in four weeks, and will build momentum through the back-to-school ... clipped from Google - 3/2010 powered by

c/c++ programs All Rights Reserved. Blogger Template created by Deluxe Templates Free Blogger Templates and Wordpress Theme by Skinpress

You might also like