Tomorrow I'm writing my exam in data structures in c language, Jenny really helped me understand merge sort...wish my luck guys, i hope you do well in your exams too.
@marbles55902 жыл бұрын
For the assignment: #include #include int main() { FILE *fp = NULL; int count = 1, charac=0; char ch; fp = fopen("abc.txt", "r"); if(fp==NULL) { printf ("ERROR"); exit(1); } while((ch=fgetc(fp))!=EOF) { if(ch==' ') { count++; } else { charac++; } } fclose(fp); printf (" Count: %d ", count); printf ("Number of Characters: %d", charac); return 0; } The variable charac is for the number of characters mam. :))
@farzanaashraf81362 жыл бұрын
We can simply write charac++ without else block.
@farzanaashraf81362 жыл бұрын
Hey mera characters count galt a rha kya bta sakt k newline ( ) b characters ,ma count ho ga?
@marbles55902 жыл бұрын
@@farzanaashraf8136 yeah i know, that's just the way how i do my code neatly
@farzanaashraf81362 жыл бұрын
@@marbles5590 Nice
@millicentwamuru3142 жыл бұрын
but in your program it doesn't account for the ' ' or aren't we supposed to include them
@hariparuchuru38582 жыл бұрын
Program to count No of characters in file This program also counts new line character also. #include #include void main() { FILE *fp = NULL; char ch; int LineCount =1, charcount =0; fp = fopen("abc.txt","r"); if (fp == NULL) { printf(" NO FIlE"); exit(1); } while((ch = fgetc(fp))!= EOF) { charcount++; if(ch == ' ') { LineCount++; } } fclose(fp); printf("The LineCount and charcount is %d and %d", LineCount, charcount); }
@gouravchandel81072 жыл бұрын
But i guss it will take also as a character but we don't want to count as a character.
@hariparuchuru38582 жыл бұрын
If you don't want to add new line Then make a if condition for character count also If(ch != ' ') Charcount++; Then you won't count new line
@ahmed.saa72 жыл бұрын
@@gouravchandel8107 you can use else statement because if statement will only run when there is so it won't count because at that time only if statement will run and in other cases else will run and it will count number of characters in file
@tejhimanshu2 жыл бұрын
correct for line count not for char count when 2 or 3 lines are empty, only ' ', then it will count that character also use charcount-LineCount for calculating characters
@naveen52852 жыл бұрын
Mam u r simply awesome, u made C easy and understanding, thank you so much
@SSingh_here3 ай бұрын
just add int len=ftell(fp); after the while loop it will give the length of file
@sahilmd178 Жыл бұрын
assignment: #include #include int main(){ FILE *fp=NULL; char character; int count=1; int ch=0; fp=fopen("countline.txt","r"); if(fp==NULL){ printf("Error in creating file"); exit(1); } while((character=fgetc(fp))!=EOF){ if(character==' '){ count++; } // } //If u want to count characters with out spaces else if(character!=' '){ ch++; } } printf("NO of lines:%d ",count); printf("No of characters:%d",ch); fclose(fp); return 0; }//hope this helped u😅
@jony-s5m2 жыл бұрын
Mam your video's are so much help full to. TQ mam for helping us 🌟
@mohankonduru63012 жыл бұрын
Mam plzz try start any other language like Java, or python like this , coz your teaching style too good mama so
@pinki2565 ай бұрын
mam please help me to prepare this program: Q. Write a program to copy all the contents of one file to another file that stores all lower-case alphabets into lower.txt upper-case alphabets into upper.txt digits into digit.txt and rest of characters into rest.txt .
@jaxonffmgamer33185 ай бұрын
Mam please help me to prepare this program: Q. Write a program to copy all the contents of one file to another file that stores all the lower-case alphabets into lower.txt upper-case alphabets into upper.txt digits into digit.txt rest of characters into rest.txt .
@parisa93742 жыл бұрын
Hello Jenny, May you please make videos on Command Line Arguments too? Thank you and you are an awesome and cool TECH LADY!
@divyanshbalodhi56422 жыл бұрын
Mazaa aa gayaa ma'am ji🙏
@Ankit-vp7nt2 жыл бұрын
Mam please make one small video to visual studio code (c programs setup).
@__SHRAVANIPACHUNURI2 жыл бұрын
Mam one doubt..that in this program how the cursor is incremented by 1 in while loop mam
@hardiksharma5574 Жыл бұрын
#include #include #include int main(int argc, char const *argv[]) { FILE *fp; fp = fopen("abc.txt", "r"); char ch; int count = 1; int k = 0; while ((ch = fgetc(fp)) != EOF) { if (ch == ' ') { count++; } else { k++; } } fclose(fp); printf("%d ", count); printf("%d ", k); return 0; }
@uniquegaming14872 жыл бұрын
I don't know what r u teaching in your videos 😂 But I'm just watching videos again and again Your explanation is going better day by day so Just Thanks
@devendradangare4402 жыл бұрын
we have't increased the file pointer but also how its taking next character ?
@vinayakghodke98712 жыл бұрын
for no of characters: #include #include void main() { FILE *fp=NULL; fp=fopen("abc.txt","r"); int count=1; char ch; char str[50]; if(fp==NULL) { printf("error"); exit(1); } // rewind(fp); while((ch=fgetc(fp))!=EOF) { if(ch==' ') { count++; } } rewind(fp); fseek(fp,0,SEEK_END); printf("No of characters=%d ",ftell(fp)); fclose(fp); printf("No of lines=%d",count); }
@satyabrata21292 жыл бұрын
Without rewind() it also cam be possible.... .. It's correct or not..
@mrinaltyagi22062 жыл бұрын
@@satyabrata2129 yes without rewind it can be done
@mrinaltyagi22062 жыл бұрын
@@satyabrata2129 this solution provided vinayak is incorrect
@tejhimanshu2 жыл бұрын
not correct
@87shortz Жыл бұрын
Mam kal exam h aaj raat ko pointer ki video one shot video upload honi chahiye
@_master_op_2 жыл бұрын
CODE for counting the characters : #include #include void main() { FILE *fp=NULL; char c; int n=0; fp=fopen("abc.txt","r"); if(fp==NULL) { printf("no file"); exit(1); } //while((c=fgetc(fp))!=EOF) for(c=fgetc(fp);c!=EOF;c=fgetc(fp)) { n++; } fclose(fp); printf("Nmber of characters are : %d ",n); }
@satyabrata21292 жыл бұрын
Bro i want to just friendship with you for coding Can you be my friend..
@_master_op_2 жыл бұрын
@@satyabrata2129 yeah why not😇
@_master_op_2 жыл бұрын
@@satyabrata2129 sid_sidharth_19
@_master_op_2 жыл бұрын
Id of instagram
@tejhimanshu2 жыл бұрын
correct for line count not for char count when 2 or 3 lines are empty, only ' ', then it will count that character also consider it also
@faisalwani80552 жыл бұрын
Mam.big fan from Kashmir....
@AmarSingh-ur5wq2 жыл бұрын
Can you make video of string, array and char related concepts , how to play with this
@Beyondimagination12 жыл бұрын
Mam if possible then u teach us on an compiler extension...like as VS Code , Dev or anything. Which u like most ..
@cinexstudio06 ай бұрын
Write a C program to replace vowels in a text file with character ‘x’
@faisalwani80552 жыл бұрын
Mam.total kitne tutorials hai..c..k????
@sriratnaforlife11322 жыл бұрын
Mam please reply I know nothing about coding and programming or algorithm How to start I learning for beginner Step to step 🙏🙏🙏
@rajudr32862 жыл бұрын
Delete,sort,word replace related programs mam in file handling
@r.k88952 жыл бұрын
Thank you very much mem.
@greenhomemusic31962 жыл бұрын
Please tell a program for sudo code...please mam🙏🙏
@saifali-zk6yp2 жыл бұрын
Big fan ma'am
@souravmete88092 жыл бұрын
mam can you make a vedio on ... 1. write a program to find and replace a word in a File by another given word
@sangeetharam13822 жыл бұрын
Useful mam Thankyou
@luckysgallery49382 жыл бұрын
mam please can you explain how to print a specific line from a file (file handling)
@Sindhu.M.V11 ай бұрын
Mam please do the chapter text processing & pattern searching
@mgjdb2 жыл бұрын
Mam please do important programs for drives
@nageshgour31482 жыл бұрын
Mam please make video about how to get job after graduation
@vinaygupta8532 Жыл бұрын
Bhai pata chal gya hoto mujhe bhi bata de ....
@dineshkantineni62322 жыл бұрын
How to delete a particular line in a file
@pkmcdry95862 жыл бұрын
Beautiful
@medasridhanya62462 жыл бұрын
Godess 🙏 tq for teaching it is easily understandable
@57samarthhatte822 жыл бұрын
wel done mam
@dineshkantineni62322 жыл бұрын
how to sort a given file
@abdulrahimjalloh363 Жыл бұрын
Thanks mam
@87shortz Жыл бұрын
Kl exam hai apki wishes chaiye
@kdnation56292 жыл бұрын
If you tech in hindi language then more people take advantage of your videos.. You know very well that most of the people of india doesn't know English..India you know very well also that we are not sons of english
@abdulrahimjalloh363 Жыл бұрын
Assignment: Number of lines and characters: #include #include int main(void) { FILE *fp = NULL; int count = 1; // Initialize count to 1 for the first line char ch; fp = fopen("abc.txt", "r"); if (fp == NULL) { printf("Error, file does not exist "); exit(1); } while ((ch = fgetc(fp)) != EOF) { if (ch == ' ') { count++; } } fseek(fp,0,SEEK_END); printf("No of characters is: %d ",ftell(fp)); printf("No of lines are: %d ", count); fclose(fp); }
@santoshkumarmahanty20482 жыл бұрын
Mamm love you so much.....u r my crush mamm
@sivapavanchowdary37552 жыл бұрын
Ma'am please explain about python 🙏
@schoollife12842 жыл бұрын
Ma'am aaj tho rest karna dho plzz
@_kucial_2 жыл бұрын
🤣🤣🤣
@tunahankarali6917 Жыл бұрын
THERE ARE MANY ADVERTİSEMENTS İT İS ANNOYİNG WHİLE I AM STUDYİNG
@howtodo23222 жыл бұрын
she getting so cute
@jitendraprajapat11922 жыл бұрын
Mem aap ko kya pdate ho
@priyanshubisht83262 жыл бұрын
Tower of Hanoi
@bhavyaandhavarapu84522 жыл бұрын
Mam explain dynamic memory allocation
@Rahul-pz9oe Жыл бұрын
Hindi me praiyye na mam smjh me nhi aata h😢
@Hemanthrr72 жыл бұрын
i love you mdama i will die for you please accept my love ❤😘
@p.adityapatro86732 жыл бұрын
I am first
@MARCO__NGАй бұрын
😒😮💨😮💨🤥🤥😒
@mohanmedmamman79002 жыл бұрын
Mam do you have a sister 🥰
@KRISHNA_VLOGS492 жыл бұрын
Im first
@robertmaina4807 Жыл бұрын
#include #include int main() { FILE *fp; int count = 1; int c; char ch; fp = fopen("abg.txt","r"); if(fp == NULL) { printf("Error opening file "); exit(1); } while((ch = fgetc(fp)) !=(EOF)) { if(ch == ' ') { count++; } } fseek(fp, 0, SEEK_END); c = ftell(fp); printf("The number of characters are %d ", c); fclose(fp); printf("The lines are %d ", count); return 0; }
@Antik-n1b5 ай бұрын
#include #include void main() { char ch; int count = 0; int k = 1; FILE *fp = NULL; fp = fopen("abc.txt", "r"); if (fp == NULL) { printf("Error"); exit(1); } while (!feof(fp)) { ch = fgetc(fp); if (ch == ' ') k = k + 1; if ((ch != ' ') && (ch != ' ')) count = count + 1; } fclose(fp); printf("No. of characters = %d ", count - 1); printf("No. of lines = %d", k); }