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 …

PROGRAM TO CHECK WHETHER A GIVEN NUMBER IS ARMSTRONG OR NOT

/*PROGRAM TO CHECK WHETHER A GIVEN NUMBER IS ARMSTRONG OR NOT*/ #include<stdio.h> #include<conio.h> void main() { int n,temp,arm=0,rem; clrscr(); printf(“Enter the number: “); scanf(“%d”,&n); temp=n; while(temp!=0) { rem=temp%10; temp=temp/10; arm=arm+rem*rem*rem; …

PROGRAM TO PRINT FIBONACCI SERIES

/*PROGRAM TO PRINT FIBONACCI SERIES*/ #include<stdio.h> #include<conio.h> void main() { int a,b,c,i,n; clrscr(); printf(“Enter the limit of the series: “); scanf(“%d”,&n); if(n<1) printf(“Enter only positive number”); else { printf(“\nFibonacci series …

PROGRAM TO CALCULATE GRADE OF A STUDENT

/*PROGRAM TO CALCULATE GRADE OF A STUDENT*/ #include<stdio.h> #include<conio.h> void main() { int max,t=0; float a,b,c,sum=0,per=0; clrscr(); printf(“Enter the maximum marks for each subject: “); scanf(“%d”,&max); printf(“Enter the marks obtained …