Pages

Tuesday, January 20, 2015

Program to assign the value to member of structure with the use of structure pointer

#include<stdio.h>
#include<stdio.h>
main ( )
{
    struct rec{
         char name[10];
          int age;
          int sal;
        }*ptr;
    strcpy(ptr->name, "suresh");
    ptr->age= 24;
    ptr->sal = 5000;
    printf ( "Name:%s\n" , ptr->name );
    printf ( "Age:%d\n" , ptr->age );
    printf ( "Salary:%d ", ptr->sal );
}

Find the G.C.D of two number

#include<stdio.h>
#include<conio.h>
void main()
{
int x,y,t;
printf("Enter two number:-");
scanf("%d%d",&x,&y);
if(x<0)
x=-x;
if(y<0)
y=-y;
if((x==0)||(y==0))
printf("is not possible:-\n");
else
{
while(x!=y)
{
if(x>y)
{
t=x;
x=y;
y=t;
}
y=y-x;
}
printf("The GCD is=%d",x);
}
getch();
}

Write Programme in c to sum of two number :

#include<stdio.h>
#include<conio.h>
void main()
{
int p,b,sum=0;
printf("Enter the number :\n");
scanf("%d%d",&p&b);
sum=p+b;
printf("Result=%d",sum);
getch();
}

Saturday, January 17, 2015

Home


WELCOME 
TO  Reader. Here this article to how learn C program in cprogrammebook.blogspot.com

In this blog has some article to read carefully and you should understand easily.... So click to program to find your article.







 Find C source code to help you to learn C programs.
1. Sum of two number. 
2. Find the G.C.D of two number
3. ABBREVIATION FORM OF GIVEN STRING