Vous êtes sur la page 1sur 1

Title Find the greatest number which can be formed using the numbers extrcted fr om the string.

Author Ginoop.c.markose Description Numbers extracted from a given string and find the greatest number w hich can be formed using these numbers:- Input:hai06ginoop665djd65 Output:The nu mbers are:6 665 65 The largest number is :666565

#include<stdio.h> #include<stdlib.h> #include<string.h> int level=-1,k=1,r=1,val[20]; char c[100][30],s1[50],s2[50],t[50]; int g,h; void main() { char ss[100],s[100]; int l,i,j,ch,m=0,n; clrscr(); strcpy(s2,"0"); printf("Enter the string "); scanf("%s",ss); l=strlen(ss); /* Extract numbers */

for(i=0;i<l;i++) { ch=(int)ss[i]; if(ch>=49 && ch<=57) { for(j=i;j<=l;j++) { ch=(int)ss[j]; if(ch>=48 && ch<=57 && j!=l) { c[k][m]=ss[j]; m++; } else { c[k][m]='

Vous aimerez peut-être aussi