HI,
Divide the number repeatedly by 10 till u get zero.
The number of digits is equal to no.of passes in the above division.
bhaskar...
User Profile
Collapse
-
-
-
open file
Loop untill EOF
begin
read line
search in the line for '='
Now copy the remaining string in to Destination.
end
close file...Leave a comment:
-
-
If x <= y, your call returns x,
If x > y, your call returns y.
Your code works correctly.
Vijay...Leave a comment:
-
rajesh,
what is there in the buf initially????? It contains garbase value. So, in the first checking of in with buf, will give unexpected result.
In ur code we don't need buf. Simply use min in place of buf and make sure min is initialized with 32767 or 65535. (Maximum value that we can give)...Leave a comment:
-
Hi,
There are tools like Valgrind, Mudflap, or LLVM can be used to detect uses of dangling pointers.
Vijay...Leave a comment:
-
-
Hi,
we can do it without need of array. Here i am trying to explain the logic...
You can implement it.
1) min and max are two unsigned integer variables.
min is initialized with possible maximum value,
max is initialized with zero.
2) Loop the following three statements for n times.
Read a number .
if the number is < min, then...Leave a comment:
-
Yes, Got ur problem.
Here is the zeroIt definition...
Code:void zeroIt(int *p) { *p = 0; return; }
Leave a comment:
-
no..no.. it's working. I have tested this.
can u post ur code again... i will see......Leave a comment:
-
This is ur code partly modified....
Code:rewind(Input); /* Read one word for the text file */ while(!feof(Input)) { fscanf(Input, "%s", string2); printf("The string2 is: %s\n",string2); if ( strcmp(string1,string2) == 0) { printf("String
Leave a comment:
-
Hi Srinivasan,
What ever the code u have written that works fine for the small input files. Getting entire file content into a char buffer is not good for larger files.
So, better read word by word and search it.
1) Open file.
2) loop until EOF
Read word
If the word is matched
break
loop endLeave a comment:
-
If you are using turbo c compiler, you can refer LET US C book written by yashwant kanitkar. In that you can find the straight example for it.Leave a comment:
-
hi,
Here is the solution... for ur problem
It is perfectly based on ur requirement
Code:#include<stdio.h> void rotate_n(int *array, int size, int n) { int ii, jj;
Leave a comment:
-
In the linux environment, if u compile the c++ code using -W and -Wall flags , u will get solution for ur requirement.Leave a comment:
-
Here is the solution for ur problem:
Code:#include<stdio.h> int main() { int x[10], key, index; for (index = 0; index < 10; index++) { printf("Enter Number %d:", index); scanf("%d",&x[index]);
Leave a comment:
-
-
One more bug in ur code is ..
Don't use & for printing fileds..Replace ments for ur error statements
printf("\nsalar y --> %.2f", arr[i].salary);
printf("\nrank --> %d", arr[i].rank);
Now ur code works perfecltly.
VijayLeave a comment:
No activity results to display
Show More
Leave a comment: