Days have September, April, June, and November
#include<stdio.h> #include<conio.h> int G[50][50],n,i,j,h,k; void FGraph(); int findR(); void main() { clrscr(); printf("\t\t\tmultistage graph"); printf("\n enter the no of vertices:"); scanf("%d",&n); printf("\n there is a edge between the follwing vertices enter its weight else 0:\n"); for (i=1;i<=n;i++) for(j=1;j<=n;j++) { G[I][J]=0; IF(I!=J)&&(i<J)) { printf ("%d and%d:",i,j); scanf(%d,&G[i][j]); } } FGraph(); getch(); } void FGraph() { int cost[50],d[50],p[50],r; for(i=1;i<=n;i++) cost[i]=0; for(j=n-1;j>=1;j++) { r=findR(j+1); cost[j]=G[j][r]+cost[r]; d[j]=r; } p[1]=1;p[k]=n; for(j=2;j<k;j++) p[i]=d[p[j-1]]; printf("%d-",d[1]); for(j=2;j<n;j++) { if((d[j]==d[j-1])(d[j]==0)) continue; if(d[j]<=n) printf("%d-"d[j]); } printf("%d",n); } int findR(int cu) { int r1=n+1; for(h=1;h<=n;h++) {if((G[h][cu]!=0)&&(r1==n+1)){ r1=j; continue; } if(G[h][cu]!=0) { if(G[h][cu]<G[r1][cu]) r1=h; }} return r1; }sorry i have answerd in c++
#include<stdio.h> typedef struct hole { int id,size,inf,ef,filled,pid,psize; }hole; typedef struct process { int id,size,comp; }process; hole h[50]; process p[50]; int m,n,intfrag,exfrag; void output() { int i; intfrag=exfrag=0; printf("\n\n\nHole Process IF EF\n"); for(i=0;i<m;i++) { printf("\n%d %d %d %d",h[i].size,h[i].psize,h[i].inf,h[i].ef); intfrag=intfrag+h[i].inf; exfrag=exfrag+h[i].ef; } } void final() { int i; for(i=0;i<n;i++) { if(p[i].comp==0) { printf("There is no memory for the process of size %d\n",p[i].size); } } } void input() { int i,max,flag; max=flag=0; printf("\nEnter total no of holes:\n"); scanf("%d",&m); for(i=0;i<m;i++) { h[i].id=i; printf("\nEnter size of hole %d:\n",i+1); scanf("%d",&h[i].size); h[i].inf=0; h[i].ef=h[i].size; h[i].filled=0; h[i].pid=0; h[i].psize=0; } for(i=0;i<m;i++) { if(h[i].size<0) { printf("\nInvalid input as hole size is negative"); flag=1; } if(h[i].size>max) { max=h[i].size; } } printf("\nEnter total no of processes:\n"); scanf("%d",&n); for(i=0;i<n;i++) { p[i].id=i; printf("\nEnter size of process %d:\n",i+1); scanf("%d",&p[i].size); p[i].comp=0; } for(i=0;i<n;i++) { if(p[i].size<0) { printf("\nInvalid input as process size is negative"); flag=1; } if(p[i].size>max) { printf("\nInvalid input as process size is greater than max size of hole\n"); flag=1; } } if(flag==0) { output(); } } void first() { int i,j; for(i=0;i<n;i++) { for(j=0;j<m;j++) { if(p[i].size<=h[j].size && p[i].comp==0 && h[j].filled==0) { p[i].comp=1; h[j].filled=1; h[j].psize=p[i].size; h[j].id=p[i].id; h[j].inf=h[j].size-p[i].size; h[j].ef=0; output(); } } } printf("\n\n\nInternal Fragmentation:%d",intfrag); printf("\n\n\nExternal Fragmentation:%d\n\n",exfrag); final(); } void best() { int min,i,j,sub,var; for(i=0;i<n;i++) { min=999; sub=0; for(j=0;j<m;j++) { if(p[i].size<=h[j].size && p[i].comp==0 && h[j].filled==0) { sub=h[j].size-p[i].size; if(min>sub) { min=sub; var=j; } } } p[i].comp=1; h[var].filled=1; h[var].psize=p[i].size; h[var].id=p[i].id; h[var].inf=h[var].size-p[i].size; h[var].ef=0; output(); } printf("\n\n\nInternal Fragmentation:%d",intfrag); printf("\n\n\nExternal Fragmentation:%d\n\n",exfrag); final(); } void next() { int i,j,a; a=j=0; for(i=0;i<n;i++) { for(j=a;j<m;j++) { if(p[i].size<=h[j].size && p[i].comp==0 && h[j].filled==0) { p[i].comp=1; h[j].filled=1; h[j].psize=p[i].size; h[j].id=p[i].id; h[j].inf=h[j].size-p[i].size; h[j].ef=0; output(); a=(j+1)%m; } } } printf("\n\n\nInternal Fragmentation:%d",intfrag); printf("\n\n\nExternal Fragmentation:%d\n\n",exfrag); final(); } void main() { int ch; printf("\n\n\n**********MEMORY ALLOCATION**********\n\n"); printf("\n1.First Fit Algorithm\n2.Best Fit Algorithm\n3.Next Fit Algorithm"); printf("\nEnter your choice:\n"); scanf("%d",&ch); switch(ch) { case 1: input(); first(); break; case 2: input(); best(); break; case 3: input(); next(); break; } } Written by: Fabianski Benjamin
a b c d e f g h i j k l m n OOOOOOOOOOOOOOO a b c d e f g h i j k l m n OOOOOOOOOOOOOOO
There are no possible words with those letters.
D-O-L-P-H-I-N I-N J-A-P-A-N-E-S-E
30 days hath September, April, June, and November.
#include<stdio.h> int main() { int n,i,j,k,a[10][10]; printf("\nEnter the number of nodes: "); scanf("%d",&n); for(i=0; i<n; i++) { for(j=0; j<n; j++) { printf("\nEnter the distance between the host %d%d:", i+1,j+1); scanf("%d",&a[i][j]); } } for(i=0; i<n; i++) { for(j=0; j<n; j++) printf("%d\t",a[i][j]); printf("\n"); } for(k=0; k<n; k++) { for(i=0; i<n; i++) { for(j=0; j<n; j++) { if(a[i][j]>a[i][k]+a[k][j]) a[i][j]=a[i][k]+a[k][j]; } } } for(i=0; i<n; i++) { for(j=0; j<n; j++) { b[i][j]=a[i][j]; if(i==j) b[i][j]=0; } } printf("\nThe output matrix is:\n"); for(i=0;i<n;i++) { for(j=0;j<n;j++) printf("%d\t",b[i][j]); printf("\n"); } return 0; }
N. J. H. Dent has written: 'Rousseau Dictionary'
#include<iostream.h> #include<conio.h> # define n 10 void main( ) { int mat[n][n]; int d; // Input elements cout<< "\n Enter dimension of square matrix:"; cin >> d; for(int i = 0; i < d ; i++) for( int j = 0; j < d ; j++) {cout<<"\n Enter elements for "<< i+1 << "," << +1<"location :"; cin >> mat[i][j]; } clrscr(); //Print the array cout<<"\n The Original matrix : \n\n"; for( i = 0; i < d ; i++) {for( j = 0; j < d ; j++) cout<< mat[i][j]<<"\t"; cout<< "\n"; } //upper half of left diagonal..... cout<<"\n The Upper half of the matrix : \n\n"; for( i = 0; i < d ; i++) { for( j = 0; j < d ; j++) { if(i < j) cout << mat [i][j] << " " ; else cout << " " << " "; } cout << "\n "; } //lower half of left diagonal..... cout<<"\n The Lower half of the matrix : \n\n"; for( i = 0; i < d ; i++) { for( j = 0; j < d ; j++) { if(i > j) cout << mat [i][j] << " " ; else cout << " " << " "; } cout << "\n "; } getch ( ); }
/* Ramana Reddy -IIIT */ #include main() { int a[10][10],i,j,m,n,sum=0; printf("Size of Matrix M*N:\n "); scanf("%d%d",&m,&n); if(m==n) { printf("\nEnter %d elements: \n",m*n); for(i=0;i
#include <stdio.h> main() { int n,i,j,a[10][10],t; clrscr(); printf("enter the limit of an array\n"); scanf("%d",&n); printf("enter the elments of an array\n"); for(i=1;i<=n;i++) scanf("%d",&a[i]); for(j=1;j<=n-i;j++) scanf("%d",&[j+1]) { t=a[j]; a[j]=a[j+1]=t; } printf("the numbers after sorting are:\n"); for(i=1;i<=n;i++) printf("%d\t",a[i]); getch(); }
#include <stdio.h> #include <conio.h> void main() { int n ,i,j,temp,a[12]; //in a[] specify some number . printf("Enter the no of inputs:"); scanf("%d", &n); printf("Enter %d integer numbers :", n); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for (i=0;i<n;i++) for(j=i+1;j<n;j++) { if(a[i]>a[j]) { temp=a[j]; a[j]=a[i]; a[i]=temp; } } printf("THE %d NUMBERS SORTED IN ASCENDING ORDER ARE :\n", n); for(i=0;i<n;i++) { printf("%d ",a[i]); } getch(); }