- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 3
- Posts with Downvotes
- 2
- Downvoting Members
- 2
5 Posted Topics
Re: Please could u provide the entire code for the above program? u see i hav tried but failed 2 understand it... | |
Re: How bout dis??? #include<iostream.h> #include<conio.h> #include<math.h> void main() { clrscr(); int a[200],i=0,dec,bin,j,k; cout<<"Enter the number:\n"; cin>>dec; int quotient=dec; do { a[i]=quotient%2; i++; quotient=quotient/2; } while(quotient!=0); int strlen=i; cout<<endl; for(i=strlen-1;i>=0;i--) { cout<<a[i]; } getch(); } | |
Heyy could any1 plz suggest sum really tough programs dat can be written in c++?? | |
Re: i've checked...dis works #include<iostream.h> #include<conio.h> #include<string.h> #include<stdio.h> void main() { clrscr(); int i,j; char sent[30]; int num[256]; for(i=0;i<256;i++) { num[i]=0; } cout<<"Enter sentence:\n"; gets(sent); int x=strlen(sent); for(i=0;i<x;i++) { num[(int)sent[i]]+=1; } for(i=0;i<256;i++) { if(num[i]!=0) { cout<<(char)i <<" = "<<num[i]<<endl; } } getch(); } | |
|
The End.