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
The given series is known as a sequence of perfect cubes with alternating signs. The rule for this series is that each term is the cube of the next integer in the sequence, alternating between positive and negative. In this case, the series starts with -1, then continues with 2^3 = 8, -3^3 = -27, 4^3 = 64, and -5^3 = -125.
#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; }