Search:

Type: Posts; User: perrrson

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    10,366

    I did it

    I finally did it. This program works. The question is solved.



    #include <stdio.h>
    #include <string.h>
    int main(){
    FILE *fp = fopen("data.txt", "r+");;
    char c;
    while ((c =...
  2. Replies
    11
    Views
    10,366

    CommonTater, I need to make the changes in the...

    CommonTater, I need to make the changes in the same file.
  3. Replies
    11
    Views
    10,366

    I tried modifying the program in this way: ...

    I tried modifying the program in this way:



    #include <stdio.h>
    #include <string.h>
    int main(){
    FILE *fp = fopen("data.txt", "r+");;
    char c;
    int l = 0;
  4. Replies
    11
    Views
    10,366

    Replace vowels in file with *

    Hi,

    I have to write a program that replaces all vowels in a given file with *. Here's my code:



    #include <stdio.h>
    #include <string.h>
    int main(){
    FILE *fp = fopen("data.txt", "r+");;
  5. Replies
    3
    Views
    8,656

    Solved

    Wait, my question is solved. The program now reverses the last word too. Here's the modified final code:



    #include <stdio.h>
    #include <string.h>
    int main(){
    char str[100];
    char temp[100];...
  6. Replies
    3
    Views
    8,656

    Thanks!

    Thanks JohnGraham! That solves a big part of the problem.

    But it is still not printing the reverse of the last word of the string. For example, when the input is "Hello how are you", the program...
  7. Replies
    3
    Views
    8,656

    Reverse words in string

    Hi, I have written a program to reverse words in a string. So if the input is: "My name is Jack", the output should be "yM eman si kcaJ".

    But my program is not outputting anything.


    ...
  8. Replies
    2
    Views
    1,195

    Accept a string with newline

    Hi, I would like to know what function should I use if I want the user to input a string with the new-line character. fgets terminates reading after a new-line character is found.
  9. Replies
    1
    Views
    5,474

    Matrix in circular form

    Hi all,

    I have got a tough assignment. I have to write a program that accepts a square matrix, and then print the matrix in circular form. For example, for the matrix:

    1 2
    3 4

    The program...
  10. Replies
    3
    Views
    2,549

    Thank you

    Thank you. Your solutions worked.
  11. Replies
    3
    Views
    2,549

    Program not working as expected

    #include <stdio.h>
    #include <string.h>
    int main(){

    char changeschedule;
    char moviename[50];
    int showtime;
    int screennumber;
    char addanothermovie;
    char mname[50];
Results 1 to 11 of 11