- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 2
Re:
Convert a decimal (denary) integer to a binary string. An exercise in do ... while and while loops. |
|
/*i know how to convert but i dont know how, if its a larger no. ex. thousands??? because it has no restriction in nos.,,what can i use?*/ |
|
[code] #include<stdio.h> int m,i,c; main() { clrscr(); for(m=1; m<=10; m++) { for(i=1; i<=10; i++) { c=m*i; printf ("%d\t",c); } printf ("\n"); } getch(); } [/code] |
|
Re:
give me the perfect program like that output.[code]#include<stdio.h> #include<conio.h> void main() { int i,j; int a=15; int b=30; clrscr(); for(i=0;i<=a;i++) { for(j=0;j<=b;j++) { if(i==0||i==2||i==a) { if(i==0||i==2) if(j==0||j==b-4||j==b) printf("+"); else printf("-"); if(i==a) if(j==0||j==b) printf("+"); else printf("-"); { if(i==1||j==14) printf("mywindow"); if(i==1||j==28) printf("X"); } } if(j==0) if(i==1||i==3||i==4||i==5||i==6||i==7||i==8||i==9||i==10||i==11||i==12||i==13||i==14) printf("|"); else printf(" "); if(j==b) if(i==1||i==3||i==4||i==5||i==6||i==7||i==8||i==9||i==10||i==11||i==12||i==13||i==14) … |
|
#include<stdio.h> #include<string.h> main() { char STR1[100]; int i; clrscr(); printf("Please input a STRING.\n"); gets (STR1); printf("\n%s is displayed in reverse form as:\n",STR1); for(i=strlen(STR1)-1; i>=0 ; i--) { printf("%c",STR1[i]); } getch(); } |
|
Re:
Hey guys, I have just written C program that calculates the force of a body using F = ma but there is some sort of problem occuring , could you please help me fix the error. |