27 Books in the New Testament
27 Books in the New Testament
void main() { int n,b=0,t; clrscr(); printf("Enter the no"); scanf("%d",&n); t=n; while(n>0) { a=n%10; b=b+a*a*a; n=n/10; } if(b==t) { printf("Armstrong no"); } else { printf("Not an Armstrong no"); } getch(); }
T. B. Ilangaratne was born on 1913-02-27.
L-I-N-D-O or B-O-N-I-T-O (masculine) L-I-N-D-A or B-O-N-I-T-A (feminine)
insatiable is a word(means cant get enuff)
<html> <head> <Script Language="JavaScript"> var a,n,b=0,t; n=parseInt(window.prompt("enter n","0")); t=n; while(n>0) { a=n%10; b=b+a*a*a; n=n/10; } if(b==t) { document.writeln("Armstrong no"); } else { document.writeln("Not an Armstrong no"); } </script> </head> </html>
// transpose for the sparse matrix void main() { clrscr(); int a[10][10],b[10][10]; int m,n,p,q,t,col; int i,j; printf("enter the no of row and columns :\n"); scanf("%d %d",&m,&n); // assigning the value of matrix for(i=1;i<=m;i++) { for(j=1;j<=n;j++) { printf("a[%d][%d]= ",i,j); scanf("%d",&a[i][j]); } } printf("\n\n"); //displaying the matrix printf("\n\nThe matrix is :\n\n"); for(i=1;i<=m;i++) { for(j=1;j<=n;j++) { printf("%d\t",a[i][j]); } printf("\n"); } t=0; printf("\n\nthe non zero value matrix are :\n\n"); for(i=1;i<=m;i++) { for(j=1;j<=n;j++) { // accepting only non zero value if(a[i][j]!=0) { t=t+1; b[t][1]=i; b[t][2]=j; b[t][3]=a[i][j]; } } } printf("a[0 %d %d %d\n",m,n,t); for(i=1;i<=t;i++) { printf("a[%d %d %d %d\n",i,b[i][1],b[i][2],b[i][3]); } a[0][1]=n; a[0][2]=m; a[0][3]=t; int s[10],u[10]; if(t>0) { for(i=1;i<=n;i++) { s[i]=0; } for(i=1;i<=t;i++) { s[b[i][2]]=s[b[i][2]]+1; } u[1]=1; for(i=2;i<=n;i++) { u[i]=u[i-1]+s[i-1]; } for(i=1;i<=t;i++) { j=u[b[i][2]]; a[j][1]=b[i][2]; a[j][2]=b[i][1]; a[j][3]=b[i][3]; u[b[i][2]]=j+1; } } printf("\n\n the fast transpose matrix \n\n"); printf("a[0 %d %d %d\n",n,m,t); for(i=1;i<=t;i++) { printf("a[%d %d %d %d\n",i,a[i][1],a[i][2],a[i][3]); } getch(); }
Transact, if you lose the "b."
b t w n
#include <stdlib.h> #include <stdio.h> #include <conio.h> int sum(int, int); int sub(int, int); int mul(int, int); int div1(int, int); int main() { int a,b,d; int ch; printf("\t\tCalculator Implementation\n"); printf("\t\t~\n"); printf("\t\t 1: Add\n"); printf("\t\t 2: Sub\n"); printf("\t\t 3: Multiply\n"); printf("\t\t 4: Divide\n"); printf("\t\t 5: Exit\n\n\n"); printf("\t\t Enter the choice: "); scanf("%d", &ch); if(ch==5) exit(0); printf("\nEnter first number: "); scanf("%d", &a); printf("\nEnter Second number: "); scanf("%d", &b); printf("\na = %d; b = %d;\n", a, b); printf("==============\n\n"); switch(ch) { case 1 : d=sum(a,b); printf("Sum %d + %d = %d",a,b,d); break; case 2: d=sub(a,b); printf("Subtraction %d - %d = %d",a,b,d); break; case 3: d=mul(a,b); printf("Multiplication %d * %d = %d",a,b,d); break; case 4 : d=div1(a,b); printf("Division %d / %d = %d",a,b,d); break; default: printf("Invalid Choice!"); getch(); } getch(); return 0; } int sum(int a, int b) { return a + b; } int sub(int a, int b) { return a - b; } int mul(int a, int b) { return a * b; } int div1(int a, int b) { return a / b; }
#include <stdio.h> #include <conio.h> void main(){ int a[10],b[10],c[10],i,j,m,n,tmp,k; printf("\nEnter the size of the 1st array:"); scanf("%d",&m); printf("\nEnter the size of the 2nd array:"); scanf("%d",&n); printf("\nEnter the 1st array values:"); for(i=0;i<m;i++){ scanf("%d",&a[i]); } printf("\nEnter the 2nd array values:"); for(i=0;i<n;i++){ scanf("%d",&b[i]); } for(i=0;i<m;i++) { for(j=0;j<m-i;j++) { if(a[j]>a[j+1]) { tmp=a[j]; a[j]=a[j+1]; a[j+1]=tmp; } } } printf("\n\n Array in the ascending order is - \n"); for(i=0;i<m;i++) { printf("\t %d",a[i]); } for(i=0;i<n;i++) { for(j=0;j<n-i;j++) { if(b[j]>b[j+1]) { tmp=b[j]; b[j]=b[j+1]; b[j+1]=tmp; } } } printf("\n\n Array in the ascending order is - \n"); for(i=0;i<n;i++) { printf("\t %d",b[i]); } i=j=k=0; while(i<n&&j<m) { if(a[i]<b[j]) c[k++]=a[i++]; else if(a[i]>b[j]) c[k++]=b[j++]; else { c[k++]=b[j++]; i++; j++; } } if(i<n) { int t; for(t=0;t<n;t++) c[k++]=a[i++]; } if(j<m) { int t; for(t=0;t<m;t++) { c[k++]=b[j++]; } } printf("\nFinally sorted join array is:"); for(k=0;k<(m+n);k++) printf("\t\n %d ",c[k]); getch(); }