- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
- Interests
- Hadoop , distributed systems, large scale data processing, and the list goes on
- PC Specs
- I prefere Fedora core OS , i am a java guy
5 Posted Topics
Re: #include<stdio.h> int pow1(int,int); void main(char* argv) { int i=0,n=0,j=0; int bin=0; printf("Enter a number \n"); scanf("%d",&n); for(i=0;n>0;i++) { j=n%2; bin=bin+j * pow1(10,i); n/=2; } printf("The binary number is %d \n",bin); } int pow1(int a , int b) { int i=0; int sum=1; for(i=0;i<b;i++) sum*=a; return sum; } | |
Re: When you are in the if loop the printf statement prints the Hello and returns true. So !true is false so the printf under if is not printed and so it goes to the else part and prints the world part. Hence youget HelloWorld as output | |
Re: one way would be select username from users where uid in (select uid from friends where fid=this.id union select fid from friends where uid=this.id) Replace this.id with the id for which you want to check for | |
Re: Hi I think allocating space using malloc should be gud enough Ex: prt_interpln *interp_coeff; interp_coeff=(prt_interpln *)malloc(sizeof(prt_interpln)); Hope this solves the problem | |
Re: [CODE] // this program takes a sorted array as input and prints the unique numbers in that array as the output // time complexity is of the order n and also checks whether the array //is sorted or not #include<stdio.h> void main(char* argv) { int a[100],b[100]; int i=0,j=0,k=0,n=0; int flag=0; … |
The End.