MyblogAd

Sunday, August 18, 2013

What would be the output of the following programs ?

main( )
{
int j ;
while ( j <= 10 )
{
printf ( "\n%d", j ) ;
j = j + 1 ;
}
}

print trangular star programme..

#include<stdio.h>
#include<conio.h>
void main()
{
int r,c,s;
for(r=1;r<=4;r++)
{
    for(s=3;s>=r;s--)
    {
        printf(" ");
    }
for(c=1;c<=r;c++)
{

printf(" *");

}
printf("\n");

}




}

febonacci series..

#include<stdio.h>
#include<conio.h>
void main()
{
   
int a=0;
int b=1;
int c;
printf("%d",a);
printf("%d",b);
c=a+b;
do
{
   
    c=a+b;
    a=b;
    b=c;
   
   
    printf("%d",c);

}
while(c<=10);
}
}


OR//OR//OR//OR

#include<stdio.h>
#include<conio.h>
void main()
{

    int i=0,j=1,k,r,f;
    printf("enter the range");
    scanf("%d",&r);
    printf("the fab series is");
    printf("%d%d",i,j);
    for(k=0;k<=r;k++)
    {
        f=i+j;
        i=j;
        j=f;
        printf("%d",j);
}
}

Accept 10 number and find the greatest of them.....


#include<stdio.h>
#include<conio.h>
void main()
{
int a;
int c;
int b=0;
for(c=1;c<=10;c++)
{
printf("enter the number");
scanf("%d",&a);
if(a>b)
{
b=a;

}

}
printf("the greatest number is %d",b);
}

Saturday, August 17, 2013

1.enter the start and end from user and find the square between the numbers...?.

#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
void main()
{
int a, b,i;
 printf("enter the numbers start");
 scanf("%d",&a);
 printf("enter the numbers end");
 scanf("%d",&b);
 for(a=a;a<=b;a++)
 {
    i=a*a;
    printf("\n %f",i);
 }

coding magics.......the language of computers...

Lets code the solution in any programming language......