PROGRAM TO PRINT A PATTERN STARTING FROM Nth ROW

/*PROGRAM TO PRINT A PATTERN STARTING FROM Nth ROW*/ #include<stdio.h> #include<conio.h> void main() { int i,j,temp,n,a; clrscr(); printf(“Enter the value for nth row: “); scanf(“%d”,&a); n=(a*2)-1; for(i=1;i<=a;i++) { temp=1; for(j=1;j<=n;j++) …

PROGRAM TO PRINT A PATTERN UPTO N ROWS

/*PROGRAM TO PRINT A PATTERN UPTO N ROWS*/ #include<stdio.h> #include<conio.h> void main() { int i,j,temp,n; clrscr(); printf(“Enter the limit of rows: “); scanf(“%d”,&n); temp=1; for(i=1;i<=n;i++) { for(j=1;j<=i;j++) { printf(“%d\t”,temp); temp++; …

PROGRAM TO PRINT A STAR SEQUENCE 3

/*PROGRAM TO PRINT A STAR SEQUENCE 3*/ #include<stdio.h> #include<conio.h> void main() { int i,j,k,temp; clrscr(); printf(“Press any key to display the sequence of stars: \n”); getch(); temp=1; for(i=1;i<=3;i++) { for(j=3-i;j>=1;j–) …

PROGRAM TO PRINT STAR SEQUENCE2

/*PROGRAM TO PRINT STAR SEQUENCE2*/ #include<stdio.h> #include<conio.h> void main() { int i,j,k; clrscr(); printf(“Press any key to display the sequence of stars: \n”); getch(); for(i=1;i<=4;i++) { for(j=4-i;j>0;j–) printf(” “); for(k=1;k<=i;k++) …

PROGRAM TO PRINT A SEQUENCE OF STARS

/*PROGRAM TO PRINT A SEQUENCE OF STARS*/ #include<stdio.h> #include<conio.h> void main() { int i,j; clrscr(); printf(“Press any key to display the pattern: \n”); getch(); for(i=1;i<=4;i++) { for(j=1;j<=i;j++) printf(“*”); printf(“\n”); } …

PROGRAM TO PRINT A PATTERN – 1

/*PROGRAM TO PRINT A PATTERN*/ #include<conio.h> #include<stdio.h> void main() { int i,j,temp=0,k; clrscr(); printf(“Press any key to display the pattern\n”); getch(); for(i=1;i<=3;i++) { for(j=1;j<=i;j++) { temp++; printf(“%d “,temp); } if(temp>1) …

PROGRAM TO FIND SIN,COS,TAN OF A NUMBER

/*PROGRAM TO FIND SIN,COS,TAN OF A NUMBER*/ #include<stdio.h> #include<conio.h> #include<math.h> void main() { float n,a,b,c; clrscr(); printf(“Enter the value for the angle: “); scanf(“%f”,&n); a=sin(n); b=cos(n); c=tan(n); printf(“Sin(%f) is: %2.2f\n”,n,a); …

PROGRAM TO DISPLAY N NATURAL NUMBERS AND THEIR SUM

/*PROGRAM TO DISPLAY N NATURAL NUMBERS AND THEIR SUM*/ #include<stdio.h> #include<conio.h> void main() { int n,i,sum=0; clrscr(); printf(“Enter the range of natural numbers: “); scanf(“%d”,&n); printf(“Natural numbers upto %d are:\n”,n); …

WAP TO FIND SUM OF INVERSE OF N NATURAL NUMBERS

/*WAP TO FIND SUM OF INVERSE OF N NATURAL NUMBERS*/ #include<stdio.h> #include<conio.h> void main() { int n; float i,inv,sum=0; clrscr(); printf(“Enter the range: “); scanf(“%d”,&n); printf(“Inverse of first %d natural …