Hello!
I have the following assgnment:
Open the file mbox-short.txt and read it line by line. When you find a line that starts with 'From ' like the following line:
From stephen.marquar d@uct.ac.za Sat Jan 5 09:14:16 2008
You will parse the From line using split() and print out the second word in the line (i.e. the entire address of the person who sent the message). Then print out a count...
User Profile
Collapse
-
Problem with split() and rstrip()
-
Showing mean and variance
Hello!
I'm writing a program that calculates and shows the mean and variance of two integers. The result I'm getting is 7. But that's not the mean of 5 and 10 (num1 and num2). What can I do to show both mean and variance together on the screen? What should I put after return to get both mean and variance?
Thank you.
#include <stdio.h>
double statistics (int x, int y){
... -
Thanks very much for your response.
I'd like go further in this code.
I 've created a function biggestPrime to tell the biggest prime number between 2 and num. The only way I could think about doing this was creating an array with numofprimes as its dimension, storing each prime number in the array and then identifying the biggest number in that array. However, I have no idea how to do that.
#include <stdio.h>... -
Prime numbers
I'm writing a program to calculate the number of prime numbers in a sequence. There's a variable called num that is given and then the program must calculate how many prime numbers there are from 2 (the smallest prime number) to num.
It should be something like that:
Enter a number greater than 1: 7 There are 4 prime numbers between 2 and 7.
This is because 2,3,5 and 7 are prime numbers, a total of 4 numbers....
No activity results to display
Show More
Leave a comment: