//the following code will help you to write the program for(i=n-1, j=0; i > 0; i--, j++) //n is the order of the square matrix { for(k=j; k < i; k++) printf("%d ", a[j][k]); for(k=j; k < i; k++) printf("%d ", a[k][i]); for(k=i; k > j; k--) printf("%d ", a[i][k]); for(k=i; k > j; k--) printf("%d ", a[k][j]); } m= (n-1)/2; //calculate the position of the middle element if (n% 2 == 1) printf("%d", a[m][m]);//to print the middle element also //9809752937(udanesh)
17
int main() { int i,j,sum,k; for(i=1;i<=5;i++) { k=1; sum =0; for(j=1;j<=i;j++) { sum = sum+(i*k); k=k*10; } cout<< sum; cout<< "\n"; } }
class Table { int n; void func(int n) { int k=2; for(int i=1;i<n;i++) { System.out.println("table of "+k); for(int j=1;j<=10;j++) { int a=j*k; System.out.print(" "+a); System.out.print(" "); } k=k+1; System.out.print("\n"); } } public static void main(String k[]) { Table t =new Table(); int num=Integer.parseInt(k[0]);//pass the number upto you want the tables eg:4 t.func(num); } }
#include<iostream.h> #include<conio.h> void main() { clrscr(); int i,k,a[10],c[10],n,l; cout<<"Enter the no. of elements\t"; cin>>n; cout<<"\nEnter the sorted elments for optimal merge pattern"; for(i=0;i<n;i++) { cout<<"\t"; cin>>a[i]; } i=0;k=0; c[k]=a[i]+a[i+1]; i=2; while(i<n) { k++; if((c[k-1]+a[i])<=(a[i]+a[i+1])) { c[k]=c[k-1]+a[i]; } else { c[k]=a[i]+a[i+1]; i=i+2; while(i<n) { k++; if((c[k-1]+a[i])<=(c[k-2]+a[i])) { c[k]=c[k-1]+a[i]; } else { c[k]=c[k-2]+a[i]; }i++; } }i++; } k++; c[k]=c[k-1]+c[k-2]; cout<<"\n\nThe optimal sum are as follows......\n\n"; for(k=0;k<n-1;k++) { cout<<c[k]<<"\t"; } l=0; for(k=0;k<n-1;k++) { l=l+c[k]; } cout<<"\n\n The external path length is ......"<<l; getch(); }
whyis the k to 12 program better thatn the current program?
K to 12 means a school that goes from kindergarten to 12the grade. - Ashlee.
k = 2 and 2 < 12
12 / sqrt(2) = 12 sqrt(2) / 2 = 6 sqrt(2)k = 6
i really dont know
It means just what it says. The K to 12 education program can give people what they need to become the nation's future leaders.
Teaching the subject mater.
They can go into all numbers of the form 12*k where k is an integer.
K-12 is the education format followed in US. K-12 education is provided online by various online schools and homeschooling. An organization called K-12 online/ K-12 Inc provides K-12 education online but is not free, it is a private organization and charges for providing K-12 education.
int i=10, j=5, k; k=i*j; // k = 10 * 5 = 50
To find the number of different pairs that can be made from 12 numbers, you can use the combination formula ( C(n, k) = \frac{n!}{k!(n-k)!} ), where ( n ) is the total number of items, and ( k ) is the number of items to choose. For pairs, ( k = 2 ), so the calculation is ( C(12, 2) = \frac{12!}{2!(12-2)!} = \frac{12 \times 11}{2 \times 1} = 66 ). Therefore, 66 different pairs can be formed with 12 numbers.
K=1