answersLogoWhite

0

telivison

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

How to write a program that for all integers i j k and l from1 to1000 finds and prints all combinations of i j k and l such that i plus j plus k equals l and ijkl?

Some of ways to solve this problem is to use four nested loops for().Something like following:...const int limit = 1000;//some code herefor (int i(0); i


How to write java program for FLAMES game?

for (int i = 0;i < nme.length() ;i++ ) { n[i] = nme.charAt(i); } for (int j=0;j < lnme.length() ;j++ ) { l[j] = lnme.charAt(j); } for (int i = 0;i < nme.length() ;i++ ) { for (int j=0;j < lnme.length() ;j++ ){ if(n[i] == l[j]){ n[i] = ' '; l[j]=' '; } } } int C = 0; for (int i = 0;i < nme.length() ;i++ ) { if(n[i] != ' ' ){ C ++; } } for (int j=0;j < lnme.length() ;j++ ) { if(l[j] != ' ' ){ C ++; } } refer this site for full coding: http://shamjeet.blogspot.in/p/java-se.html#c


Longest common subsequence problem program in c?

#include<stdio.h> #include<string.h> int max(int a,int b) { return a>b?a:b; }//end max() int main() { char a[]="xyxxzxyzxy"; char b[]="zxzyyzxxyxxz"; int n = strlen(a); int m = strlen(b); int i,j; for(i=n;i>=1;i--) a[i] = a[i-1]; for(i=m;i>=1;i--) b[i] = b[i-1]; int l[n+1][m+1]; printf("\n\t"); for(i=0;i<=n;i++) { for(j=0;j<=m;j++) { if(i==0 j==0) l[i][j]=0; else if(a[i] == b[j] ) l[i][j] = l[i-1][j-1] + 1; else l[i][j] = max(l[i][j-1],l[i-1][j]); printf("%d |",l[i][j]); } printf("\n\t"); } printf("Length of Longest Common Subsequence = %d\n",l[n][m]); return 0; }


What did Stephen j poplawski invent?

Stephen J. Poplawski invented the blender in 1922


C plus plus program to enter 1 01 101 0101?

#include<stdio.h> #include<conio.h> void main() { int i,j,k=0,l; clrscr(); for(i=1;i<=5;i++) { for(j=1;j<=i;j++) { k++; printf("%d ",k%2); } for(l=i;l<=4;l++) { k++; } printf("\n"); } getch(); }