Hello,
I was asked to write a C program to find minimum normalized positive number that can be represented in my computer. I know that the value is 2.2250738585072 014e-308.
I wrote the program to find the machine precision. Now i need to make some parameter changes to this program to find the min. number given above.
do
{
Epsilon = Epsilon/2.0 ; //Variable value is halved until the smallest
...
User Profile
Collapse
-
Finding minimum normalized positive number
-
Text file reading
Hello,
I was wondering how to get a particular line from a text file. I wanted to output specific lines from a textfile to the console. but the ways i tried is giving me the whole text file. Any help would be great!!
Thanks in advance -
yes i tried your method too.. it is giving me the same result. I guess i would have to make some changes in the reverseFunction for your method ro work.I'll keep trying by finding what string.split() does and by changing reverseFunction around :)
thanksLeave a comment:
-
when i try reversing like you said by passing the string line to reverse function it is even reversing the string.
Eg: Hello World! ---> !dlroW olleH
but i want ----> olleH !dlorWLeave a comment:
-
this is my first asiignment i was kind of exploring different types and methods.. i guess :)Leave a comment:
-
sorry i forgot the documentation part
try{
//reads from file
BufferedReader Buf = new BufferedReader( new FileReader(File name));
String line;
while((line = Buf.readLine()) != null){
StringTokenizer token = new StringTokenizer (line);
int number = token.countToke ns();...Leave a comment:
-
I tried the code it's working but there is a problem..
I tokenized the sentences from a file
Hello World
Good Morning Everyone!!
I was suppose to reverse each word and output the result: right now i am
getting
olloH dlroW dooG gninroM !!enoyrevE ( how do i make this into 2 different lines like in the file)?
try{
BufferedReader...Leave a comment:
-
-
tokens to string
I am a newbie at Java. I am doing an assignment on string manipulations. Can anyone give me tips on how to make tokens back into a sentence.
Eg.
Good ------>(to) Good Morning Everyone!!
Morning
Everyone!!
thanks in advance -
it worked!!!!! thankyou.
i changed the code a little bit..
for(int i = (temp.length() -1); i>=0;i--)Leave a comment:
-
I was trying to work on the code but i keep getting the error
cannot find symbol
symbol : method size()
location: class java.lang.Strin g
for(int i = (temp.size()-1);i>=0;i--)
I did import java.io and java.util in the beginning of the program.
thanks in advance :)Leave a comment:
-
reversing characters in a word
Hello,
I am new to java and i was having a hard time figuring out on how to do certain string manipulations. I was asked to read in a text file and reverse the words. So far, I have put all the words in the text file into an arraylist.
For example...
Hello World. ---> must be printed out as --> olleH .dlroW
right now when i print my arraylist i am getting
... -
matrix multiplication (1d to 2d mapping) lost!!!
hello,
i have 2 upper triangular matrices A and B.. the values are stored in efficient format in the text file. I wanted to use those values for matrix multiplication and display the result C on the screen.
I am supposed to use 1d arrays. SO, basically i have 2 --> 1d arrays which i am supposed to multiply to get C[i].C[i] must not store zeroes(i.e it must also be in efficient format).
I am having trouble in... -
confused with strcat() :(
hello,
I am supposed to concatenate 2 strings (words). For this the function should call malloc or calloc to get memory for the newstring(after concatenated) .I am not allowed to use the library string.h. I figured out to find the length of the 2 strings. .. but i don't get how to concatenate the two words.
P.S This is the first time i am doing program with dynamic memory allocation.
so far this is my code:
...Code:#include<stdio.h>
Last edited by Niheel; Oct 6 '06, 02:12 AM. -
storing word from a file into 2d array
hello,
i am having trouble storing word from a text file into a 2d array in C. the array size is 20 by 20 and i am required to store one word in each row. For some reason i don't get how to use a nested for loop to switch to next row after reading the first word.
This program is for sorting the words lexicographical ly into another text file.I am not allowed to use string header for this.
any help would be appreciated
...
No activity results to display
Show More
Leave a comment: