C Language Employee Manager Exercise 8: C Tutorial In Hindi #48

  Рет қаралды 74,828

CodeWithHarry

CodeWithHarry

Күн бұрын

Пікірлер: 167
@tiktokvirals8815
@tiktokvirals8815 5 жыл бұрын
I think you should get the best coder award on youtube.
@codewithharryfanchannel559
@codewithharryfanchannel559 5 жыл бұрын
Best l. I. Tian. I agree with you
@AnkitKumar-zm1dj
@AnkitKumar-zm1dj 3 жыл бұрын
I agree
@Marcoo_Editz
@Marcoo_Editz 2 жыл бұрын
the best coding teacher you can say.
@vaibhavbhardwaj48
@vaibhavbhardwaj48 5 жыл бұрын
This Course is the best on KZbin... Can we expect advance C programming and full course on C++ from basic to advance.....??? I am waiting for this..
@angrosh.5957
@angrosh.5957 2 жыл бұрын
#challane accepted I am very excited for this challange i must do my best to solve the problem
@beyondzetabyte
@beyondzetabyte 5 жыл бұрын
Harry Bhai after this series please make the series of c++. Abhi to mein Python tutorials dekh Raha Hoon but uske baad game development KE liye c++ Sikhna hai. Btw your videos are best
@Divij_tanwar
@Divij_tanwar 4 жыл бұрын
Yes this is very helpful course..
@raghavgupta3168
@raghavgupta3168 5 жыл бұрын
Harry bhai you are helping us alot. Now, please teach Data Structures aur Algorithms for Product Based Companies. Please-Please🙏🙏
@RohanDasRD
@RohanDasRD 5 жыл бұрын
Bhai Ai With Ml Daalo!
@Chirag_Sharma_
@Chirag_Sharma_ 3 жыл бұрын
you and your course is the best sir!
@rrcreation5934
@rrcreation5934 5 жыл бұрын
Sir.. No doubt you are doing great job.. But Maine C language start kia apne kafi acha bataya.. But woh beginners ke liye samjhne me thoda problem ho rhi hai.... Woh gcc ka utna samjh nhi aya..
@rudradub7171
@rudradub7171 Жыл бұрын
Same bhai idhr bhi
@aditisingh7098
@aditisingh7098 Жыл бұрын
#challangeaccepted /*Dynamic Memory Allocation ABC Pvt Ltd. manages employee records of other companies. Employee Id can be of any length and it can contain any character For 3 employees, you have to take 'length of employee id' as input in a length integer variable. Then, you have to take employee id as an input and display it on screen. Store the employee id in a character array which is allocated dynamically. You have to create only one character array dynamically EXAMPLE: Employee 1: Enter no of characters in your eId 45 Dynamically allocate the character array. */ #include #include #include int main() { int input; char *ptr ; int n = 3; for (int i = 0; i < n; i++) { printf("Enter the length of the your employ id. "); scanf("%d" , &input); ptr = (char*) calloc (input,sizeof(char)); printf("Please enter your employ id. "); scanf("%s" , &(*ptr)); if (strlen(ptr)== input) { printf("The employ id of first employ is :" ); for (int i = 0; i < input; i++) { printf("%c" , ptr[i]); } printf(" "); } else { printf("Sorry invalid input of employee id given "); } } return 0; }
@sumitjadhav1054
@sumitjadhav1054 Жыл бұрын
@ballapranavachaitanya3975
@ballapranavachaitanya3975 11 ай бұрын
thanks a lot very helpful
@LPUEDITS
@LPUEDITS 7 ай бұрын
bhen free to kar leti calloc ko
@mrinmoydeka1232
@mrinmoydeka1232 4 ай бұрын
realloc vhi use karna tha...
@bismage69
@bismage69 4 ай бұрын
if statement ke andar aate hi sabse pehle agar ptr = (char*) realloc(ptr, strlen(ptr)); karde to aur thodi memory save ho sakti hai aur aur aapne jo if(strlen(ptr) == input) kiya h uski jagah par if(strlen(ptr)
@girishingale4273
@girishingale4273 4 жыл бұрын
I love you 300 haryy bhai! 300th like! And also challenge accepted!
@ayanavadas6154
@ayanavadas6154 3 жыл бұрын
Yes the questions are good and do give questions.
@royfamily9273
@royfamily9273 2 жыл бұрын
Baria course hai Harry Bhaiya.
@barunjena6171
@barunjena6171 4 жыл бұрын
Challenge accepted. I am currently working on the program and it's quite easy but I have one doubt. Is my size of array decreasing if I don't use realloc but instead malloc is called again in for loop and I enter a smaller length?
@moveonvillain1080
@moveonvillain1080 3 жыл бұрын
it simply rewrites the memory
@nishatmunshi4672
@nishatmunshi4672 2 жыл бұрын
you should free the memory first before leaving one cycle of the loop
@vaibhavpuri584
@vaibhavpuri584 3 жыл бұрын
Love you bhai 🥰🔥🔥
@royfamily9273
@royfamily9273 2 жыл бұрын
Thanks Harry Bhaiya
@zamankhan1255
@zamankhan1255 5 жыл бұрын
harry bhai node js pe videos banao
@arjunsonani7875
@arjunsonani7875 5 жыл бұрын
Bhai Harry ek baat puchni thi ki Jo TheTekkitRealm channel pe 365 days subway surfers game khelne ka challenge Kia hai toh kya usme machine learning use Kia hai kya?????
@sanjanakeshri4598
@sanjanakeshri4598 4 жыл бұрын
Thanks sir , I really learned it ☺😘
@allenhuntsman
@allenhuntsman Жыл бұрын
Chummi kyu de rhi h bhai
@iloveiit7040
@iloveiit7040 5 жыл бұрын
I want to know that what is the benefit of learning C language in this era of Artificial intelligence, block chain and Android app development
@shubhamjaiswal2322
@shubhamjaiswal2322 5 жыл бұрын
Software development field still prefers to use C or C++ for the development as this language is closest to the machine and faster than other languages(interpreted language). C language is preferred over other languages as it communicates with the machine easily. You can see his first video of C playlist, there he has explained that why learning C is important today and for the future aspect.
@iloveiit7040
@iloveiit7040 5 жыл бұрын
@@shubhamjaiswal2322 bro the era is changing now the trend is for Python and JavaScript.somehow c++ from game development point Of views in unreal engine thats it
@shubhamjaiswal2322
@shubhamjaiswal2322 5 жыл бұрын
@@iloveiit7040 Bro Python can not be considered good where you need quick response and faster work, I also love python as it is vast but it is not recommended to use python where we need to communicate directly to the machine. Even today there are so many companies who prefer C and C++ for the development for getting faster response from machine
@anantgupta1188
@anantgupta1188 3 жыл бұрын
if you are into development hardware things like an operating system, a mouse, keyboard etc. You really need to learn languages like C/C++ because other languages don't have access to some contents like pointers, memory allocation etc.
@sudeshnabiswas4811
@sudeshnabiswas4811 Ай бұрын
Sir please upload a Ai, ML based course
@engineerbhai7642
@engineerbhai7642 5 жыл бұрын
BestC tutorials in you tube
@erdevkumar7
@erdevkumar7 7 ай бұрын
Nice series
@oneplusoneeleven7550
@oneplusoneeleven7550 5 жыл бұрын
Ik video nexpos rapid 7 please
@codewithharryfanchannel559
@codewithharryfanchannel559 5 жыл бұрын
Best coder in India.
@user-wm3sp6uu3g
@user-wm3sp6uu3g Жыл бұрын
Challenge accepted🔥🔥
@himanshushukla5356
@himanshushukla5356 2 жыл бұрын
thanks
@smartapplications5517
@smartapplications5517 4 жыл бұрын
Best codyuber
@awdheshthakur7009
@awdheshthakur7009 3 жыл бұрын
Bhai please make video on swift language
@krishmehta5418
@krishmehta5418 5 жыл бұрын
can I use code blocks
@NickName-fz7jk
@NickName-fz7jk 5 жыл бұрын
Hii sir please start c# course
@krishmehta5418
@krishmehta5418 5 жыл бұрын
I had instal c/c++ in vs code but the colors are not been displayed and cmd when I write gcc it say fatal error no input files
@anotech4411
@anotech4411 2 жыл бұрын
you need to in put mingw compiler file in it
@rajurajesh-c3f
@rajurajesh-c3f Жыл бұрын
Completed !!! #include #include int main(){ printf("\t\t\t "); char* ptr; int size; for(int i=0;i
@krishmehta5418
@krishmehta5418 5 жыл бұрын
sir ab vs code main gcc ho gaya ha jab meme apke 4 tut la code use keya tobhi nahi chal raha hai kya AP muge apna email doga to bara bar bat kar saku
@kuldeepgaur2272
@kuldeepgaur2272 4 жыл бұрын
hi would you resolve it??
@kuldeepgaur2272
@kuldeepgaur2272 4 жыл бұрын
if not email me kuldeep9754040979@gmail.com
@legendarychest1630
@legendarychest1630 5 жыл бұрын
/*Author:Md Shoaib Purpose: Dynamic Memory Allocation Date:14/07/2019 */ #include #include int main() { //variable declaration int nChar; char *ptr; for (int i = 0; i < 3; i++) { printf("Enter no of characters in your Employee Id: "); scanf("%d", &nChar); ptr = (char *)malloc((nChar + 1) * sizeof(char)); printf("Enter your Employee Id: "); scanf("%s", ptr); printf("Your Employee Id is %s ", ptr); free(ptr); } return 0; }
@barunjena6171
@barunjena6171 4 жыл бұрын
Does your string take input as both letters and digits?
@eldrago3140
@eldrago3140 3 жыл бұрын
@@barunjena6171 Since it's a string . It can take any values as a string as long as its between " " . So "KHIO&*()&^)5646" is also a string.
@tsbgaming5770
@tsbgaming5770 3 жыл бұрын
Bro ye sacnf me &ptr kyu nahi lagya sirf ptr kyu lagya
@Sunny-qy1fj
@Sunny-qy1fj 2 жыл бұрын
@The Hustlers bhai par isne #include bhi declared nhi kiya
@Sunny-qy1fj
@Sunny-qy1fj 2 жыл бұрын
@The Hustlers ok bro thanks
@rivines
@rivines 3 жыл бұрын
I made this program but even if I give 3characters as length and try typing more than 3 it accepts and print all the characters
@amandayal5410
@amandayal5410 3 жыл бұрын
Exactly same problem with my code
@ayushkumarmehta5336
@ayushkumarmehta5336 3 жыл бұрын
Yaa, that's my doubt too.
@shubhamshukla134
@shubhamshukla134 2 жыл бұрын
use if else condition
@stack_of_knowledge
@stack_of_knowledge 2 жыл бұрын
#include #include #include int main() { char *id; int len; for (int i = 0; i < 3; i++) { printf("Enter the length of your company's employee id: "); scanf("%d", &len); id = (char *) malloc(len*sizeof(char)); reenter: printf("Enter employe id: "); scanf("%s", id); getchar(); if (strlen(id) < len || strlen(id) > len) { printf("Invalid id, please re-enter: "); goto reenter; } else printf("Entered id is %s. ", id); free(id); } return 0; }
@karthikramesh4573
@karthikramesh4573 3 жыл бұрын
Printf(" Challenge accepted ");
@hlgff6299
@hlgff6299 9 ай бұрын
P should be small printf
@nishviral799
@nishviral799 5 жыл бұрын
Bhai help how to fix pyaudio not installing problem in python
@CREePeR-211
@CREePeR-211 2 жыл бұрын
harry bhai lofic buildibg mai problen aa rahi hai
@kikubakery6368
@kikubakery6368 4 жыл бұрын
Op sir
@smitsoni6078
@smitsoni6078 Жыл бұрын
challenge accepted sir CODE :- #include #include #include int main() { // Method 1: int total_Emp; char *ptr; int n; // size of an char array printf(" Enter no. of Employees = "); scanf("%d", &total_Emp); for (int i = 1; i
@nishviral799
@nishviral799 5 жыл бұрын
It's say portaudio.h not found
@krishmehta5418
@krishmehta5418 5 жыл бұрын
please help me installing gcc compiler in vs after seeing your tut 10 time and working on it
@SoaibAslamOfficial
@SoaibAslamOfficial 2 жыл бұрын
Soaib aslam
@blockchaindaily2348
@blockchaindaily2348 3 жыл бұрын
१ अपृल,२०२१; 1,April 2021;
@kibriahasan4057
@kibriahasan4057 4 жыл бұрын
সব ভিডিও গুলো বাংলা ভার্সন (ডাবিং) বা বাংলা ভাষায় বের করেন ভাই।
@sb_infi
@sb_infi 3 жыл бұрын
Tumi kibhabe jano uni bangali
@kibriahasan4057
@kibriahasan4057 3 жыл бұрын
@@sb_infi kno??????
@kibriahasan4057
@kibriahasan4057 3 жыл бұрын
@@sb_infi kno??????
@sb_infi
@sb_infi 3 жыл бұрын
@@kibriahasan4057 Ami khali jigesh korechilam..
@rishabhgoyal7249
@rishabhgoyal7249 3 жыл бұрын
Challenge accepted!
@balramnaik370
@balramnaik370 5 ай бұрын
#include #include int main(int argc, char *argv[]) { int*ptr,length,i,n=3; for(i=1;i
@jaypatel9392
@jaypatel9392 4 жыл бұрын
Challenge accepted
@Entertainment-fl6ep
@Entertainment-fl6ep Жыл бұрын
Kasa hay?? #include #include #include void function(int input) { static int i; if (input == 1) { i++; printf("Enter the length of %dno. employee's id :", i); } else if (input == 2) { printf("Enter the employee's id :"); } else if (input == 3) { printf("You have entered a invalid id "); } } int main() { int m, n = 1, o = 2, p = 3; char *ptr; return_0: function(n); scanf("%d", &m); ptr = (char *)calloc(m, sizeof(char)); function(o); scanf("%s", ptr); if (strlen(ptr) == m) { printf("The first employee's id is :-%s ", ptr); } else { function(p); goto return_0; } return_1: function(n); scanf("%d", &m); ptr = (char *)calloc(m, sizeof(char)); function(o); scanf("%s", ptr); if (strlen(ptr) == m) { printf("The second employee's id is :-%s ", ptr); } else { function(p); goto return_1; } return_2: function(n); scanf("%d", &m); ptr = (char *)calloc(m, sizeof(char)); function(o); scanf("%s", ptr); if (strlen(ptr) == m) { printf("The third employee's id is :-%s ", ptr); } else { function(3); goto return_2; } return 0; }
@shehryarabbasi7809
@shehryarabbasi7809 Жыл бұрын
#include #include #include int main() { char *ptr; int length; printf("enter the length of your employee ID "); scanf("%d", &length); ptr = (char *)calloc(length, sizeof(char)); firstEmployee: printf("enter the employee ID: "); scanf("%s", &(*ptr)); if (strlen(ptr) == length) { printf("the employee id of the 1st employee is :"); for (int i = 0; i < length; i++) { printf("%c", ptr[i]); } } else { printf("invalid employeeId format!"); goto firstEmployee; } printf(" "); secondEmployee: printf("enter the length of your employee ID "); scanf("%d", &length); ptr = (char *)realloc(ptr, length * sizeof(char)); printf("enter the employee ID: "); scanf("%s", &(*ptr)); if (strlen(ptr) == length) { printf("the employee id of the 2nd employee is :"); for (int i = 0; i < length; i++) { printf("%c", ptr[i]); } } else { printf("invalid employeeId format!"); goto secondEmployee; } printf(" "); thirdEmployee: printf("enter the length of your employee ID "); scanf("%d", &length); ptr = (char *)realloc(ptr, length * sizeof(char)); printf("enter the employee ID: "); scanf("%s", &(*ptr)); if (strlen(ptr) == length) { printf("the employee id of the 3rd employee is :"); for (int i = 0; i < length; i++) { printf("%c", ptr[i]); } } else { printf("invalid employeeId format!"); goto thirdEmployee; } printf(" "); free(ptr); return 0; }
@tanmay_b_07
@tanmay_b_07 6 ай бұрын
09-06-24
@BOT-px7ub
@BOT-px7ub Жыл бұрын
#include #include #include #include int main(void) { int no; char info[1000]; for (int i = 0; i < 3; i++) { printf("Enter the total number of charecters in your eID "); scanf("%d",&no); char *ptr = (char *)malloc(no * sizeof(char)); printf("Enter information of employee no.:%d ", i + 1); gets(ptr); printf("Information of employee no.%d: ", i + 1); puts(ptr); free(ptr); } return 0; }
@MUHAMMADIBRAHIM-up3mb
@MUHAMMADIBRAHIM-up3mb 3 жыл бұрын
challenge accepted
@mahendrajain6752
@mahendrajain6752 3 жыл бұрын
Challenge accept
@SourashmiDas
@SourashmiDas Жыл бұрын
#include #include #include int main() { int n,a; printf("enter the size of the number: "); scanf("%d",&n); char* ptr; char* ptr1; ptr=(char*) malloc ((n+1)* sizeof(char)); ptr1=(char*) malloc ((n+1)* sizeof(char)); printf("enter the number you want to check palindrome or not: "); scanf("%s",&(*ptr)); ptr1=strrev(ptr); printf("%s",ptr1); if(ptr==ptr1){ printf("number is palindrome"); } else{ printf("number is not a palindrome"); } return 0; } why this program is not working correctly?...what's the mistake?
@kshitij.rajvanshi.9
@kshitij.rajvanshi.9 Жыл бұрын
#include #include #include int main(){ int length; char* EmpId; restart: printf("enter the characters length of Employee IDs "); scanf("%d", &length); EmpId = (char*)calloc(length, sizeof(char));// after taking lengths input, it will assign the size to char variables int No_of_employees; printf("Now tell me how many employees are currently working: "); scanf("%d", &No_of_employees); for (int i = 0; i
@hwaiting3573
@hwaiting3573 3 жыл бұрын
Challenge Accepted
@SourashmiDas
@SourashmiDas Жыл бұрын
sorry this was exercise no-11
@kavyagupta_3232
@kavyagupta_3232 3 жыл бұрын
Challenge Accepted Edit - Mission accomplished Code in reply 🌟
@moveonvillain1080
@moveonvillain1080 3 жыл бұрын
Were you able to solve the problem yet?
@MizanurRahaman03
@MizanurRahaman03 4 жыл бұрын
//challenge accepted; #include #include int main() { //printf("%d ",sizeof(int)); //printf("%d ",sizeof(char)); int n; char *a; // int i; a = (char *)malloc(n* sizeof(char)); for (int i = 1; i
@mizanmulani6563
@mizanmulani6563 2 жыл бұрын
same name
@MizanurRahaman03
@MizanurRahaman03 2 жыл бұрын
@@mizanmulani6563 😂😂😂😂
@chemision1630
@chemision1630 5 жыл бұрын
Bhai aaj tu bata hi Deeh ki tu Hindi Gaming Zone Chennle Par Video Dalega Ya Nahi 😡😡😡😠😠😠
@bhuvandahal421
@bhuvandahal421 2 жыл бұрын
//employee manager exercise 8 #include #include #include int main() { char *ptr; int n; printf("Enter the size of the array you want to create: "); scanf("%d", &n); ptr = (char *)malloc(n*sizeof(char)); for(int i = 0; i < n; i++) { printf("Enter the value at %d of the array: ", i); scanf("%c", &ptr[i]); } printf("Employee 1: "); printf("The Employee ID is: "); for(int i = 0; i < n; i++) { printf("%c", ptr[i]); } getch(); clrscr(); printf("Enter the size of the array you want to create: "); scanf("%d", &n); ptr = (char *)realloc(ptr, n*sizeof(int)); for(int i = 0; i < n; i++) { printf("Enter the value at %d of the array: ", i); scanf("%c", &ptr[i]); } printf("Employee 2: "); printf("The Employee ID is: "); for(int i = 0; i < n; i++) { printf("%c", ptr[i]); } getch(); clrscr(); printf("Enter the size of the array you want to create: "); scanf("%d", &n); ptr = (char *)realloc(ptr, n*sizeof(int)); for(int i = 0; i < n; i++) { printf("Enter the value at %d of the array: ", i); scanf("%c", &ptr[i]); } printf("Employee 3: "); printf("The Employee ID is: "); for(int i = 0; i < n; i++) { printf("%c", ptr[i]); } getch(); }
@bismage69
@bismage69 4 ай бұрын
(#challengeaccepted) #include #include #include int main(){ int input ; char *ptr; int n = 3; for (int i = 0; i < n; i++) { printf("Enter the length of emplyee id "); scanf("%d", &input); ptr = (char*)malloc(input*sizeof(char) ); printf("Enter employee id "); scanf("%s", ptr); if (strlen(ptr)
@Asimbajwa777
@Asimbajwa777 Жыл бұрын
100% Correct Solution #include #include int main() { int numEmployees = 3; int length; for (int i = 0; i < numEmployees; i++) { printf("Employee %d: ", i + 1); printf("Enter the length of employee ID: "); scanf("%d", &length); // Dynamically allocate memory for the character array char *employeeID = (char *)malloc((length + 1) * sizeof(char)); if (employeeID == NULL) { printf("Memory allocation failed. "); return 1; } printf("Enter the employee ID: "); scanf("%s", employeeID); printf("Employee ID for Employee %d: %s ", i + 1, employeeID); // Free dynamically allocated memory free(employeeID); } return 0; }
@Tanishq_29
@Tanishq_29 Жыл бұрын
Code #include #include int main() { char *ptr; int n; for (int i = 1; i < 4; i++) { printf("Employee %d: ", i); printf("Enter the no. of characters in your E-id "); scanf("%d", &n); ptr = (char *)malloc(n * sizeof(char)); printf("Enter your employee E-id: "); scanf("%s", ptr); printf("The E-id of employee %d is %s ", i, ptr); ptr = (char *)realloc(ptr, n * sizeof(char)); } return 0; }
@user-oi3iu7np9l
@user-oi3iu7np9l Жыл бұрын
The first time i could solve a exercise in one go : 😄 #include #include void main(){ int a,len; printf("*********************Welcome to ABC PVT. LIMITED*************************** "); printf("Insert the number of Employee ID's:"); scanf("%d",&a); struct EmployeeDetails{ char name[20]; char *EmployeeId[]; }Employee[a]; printf("Enter the length of charecter id:"); scanf("%d",&len); for(int i=0;i
@--kakashi
@--kakashi 2 жыл бұрын
#include #include void exercise(char *ptr, int length) { printf("Enter the Emp Id : "); scanf("%s", &(*ptr)); printf("The Emp Id is : "); for (int i = 0; i < length; i++) { if (ptr[i] != '\0') { printf("%c", ptr[i]); } else { break; } } } int main(int argc, char const *argv[]) { printf("*****ABC Pvt. Ltd.***** "); // For Employee 1 int length; printf("Enter the no. of char length you want for Emp Id 1: "); scanf("%d", &length); char *ptr = (char *)malloc(length * sizeof(char)); exercise(ptr, length); // For Employee 2 printf(" Enter the no. of char length you want for Emp Id 2: "); scanf("%d", &length); ptr = (char *)realloc(ptr, length * sizeof(char)); exercise(ptr, length); // For Employee 3 printf(" Enter the no. of char length you want for Emp Id 3: "); scanf("%d", &length); ptr = (char *)realloc(ptr, length * sizeof(char)); exercise(ptr, length); free(ptr); return 0; }
@AhmadRizviYT
@AhmadRizviYT Жыл бұрын
#include #include int main() { char *emps[3]; int n; for (int i = 0; i < 3; i++) { printf("Employee %d: ", i + 1); printf("Enter no of characters in your eId "); scanf("%d", &n); emps[i] = (char *)malloc(n * sizeof(char)); printf("enter employee id "); scanf("%s", emps[i]); } printf(" "); for (int i = 0; i < 3; i++) { printf("Id for employee %d is %s ", i + 1, emps[i]); } return 0; }
@manoor0858
@manoor0858 5 ай бұрын
#include #include #include void main() { int a,b; char *ptr; printf("Enter the number of employees "); scanf("%d", &a); for (int i = 0; i < a; i++) { printf("Enter the number of characters your ID will have "); scanf("%d", &b); printf("Enter your id "); ptr = (char *)calloc(b, sizeof(char)); scanf("%s", &*ptr); if (strlen(ptr) == b) { printf("ID of employee %d : ", i + 1); printf("%s ", ptr); free(ptr); } else { printf("Error "); break; } } }
@nishatmunshi4672
@nishatmunshi4672 2 жыл бұрын
here is my answer #include #include #include char *ptr; void main() { int n; // number of characters in id( variable ) for (int i = 0; i < 3; i++) { repeat: printf("Employee %d: ", i + 1); printf("\tEnter the number of characters in your eId: "); scanf("%d", &n); ptr = (char *)calloc((n + 1), sizeof(char)); // one more char needed for \0 printf("\tEnter your id: "); scanf("%s", ptr); if (strlen(ptr) == n) { printf(" \tThe eId for Employee %d is: %s ", i + 1, ptr); free(ptr); } else { printf("Sorry number of characters did not match. "); free(ptr); goto repeat; } } }
@cocclashingclashoftitans1156
@cocclashingclashoftitans1156 2 жыл бұрын
Challneg accepted // Online C compiler to run C program online #include #include #include int main() { char*ptr; int n1, n2, n3; printf("ABC pvt Ltd welcomes you : we will happy to serve you "); printf("Enter the length of your employee id : "); scanf("%d",&n1); ptr =(char*)malloc(n1*sizeof(char)); printf("Enter your employee id no :- "); scanf("%s",ptr); printf("This is your employee id:- %s ",ptr); printf(" Welcome employee no. 2 "); printf(" enter the length of your employee id: "); scanf("%d",&n2); ptr =(char*)realloc(ptr, n2*sizeof(char)); printf("Enter you employee id no :- "); scanf("%s",ptr); printf("This is your employee id :- %s",ptr); printf(" welcome employee no. 3"); printf(" enter the length of your employee id :"); scanf("%d",&n3); ptr =(char*)realloc(ptr, n3*sizeof(char)); printf(" Enter your employee id no :-"); scanf("%s",ptr); printf(" This is your employee id :- %s", ptr); free(ptr); return 0; }
@NoahSSP
@NoahSSP Жыл бұрын
#include #include #include int main() { int n; char *eID; for(int i=0;i
@priyaaggarwal8745
@priyaaggarwal8745 Жыл бұрын
Solution #include #include int main() { char *ptr; int v; printf("Enter number of character in your id: "); scanf("%d", &v); ptr = (char *)malloc(v * sizeof(char)); printf("Enter your Id: "); scanf("%s", ptr); printf("Enter number of character in your id: "); scanf("%d", &v); ptr = (char *)realloc(ptr, v * sizeof(char)); printf("Enter your Id: "); scanf("%s", ptr); printf("Enter number of character in your id: "); scanf("%d", &v); ptr = (char *)realloc(ptr, v * sizeof(char)); printf("Enter your Id: "); scanf("%s", ptr); return 0; }
@funhourswithyash
@funhourswithyash 9 ай бұрын
#include #include int main(){ char* ptr; int a; for (int i=1;i
@user-wm3sp6uu3g
@user-wm3sp6uu3g Жыл бұрын
#include #include #include int main() { char *Id; int n; printf("Employee 1 "); printf("Enter the no of character in id "); scanf("%d",&n); Id = (char*)malloc(n*sizeof(char)); scanf("%s",Id); if (strlen(Id)
@vikustorm3411
@vikustorm3411 2 жыл бұрын
#include #include #include int get_data(int n){ char *ptr; ptr=(char*)calloc(n ,sizeof(char)); repeat: printf("enter your id:- "); scanf("%s" , ptr); if(strlen(ptr)==n){ puts(ptr); } else{ printf("Sorry invalid input of employee id given TRY AGAIN "); goto repeat; } } int main(){ int n; for(int i=0; i
@chitranshigupta9900
@chitranshigupta9900 6 ай бұрын
#include #include int main() { char *eid; int length; for (int i=1; i
@decapitator3987
@decapitator3987 Жыл бұрын
#include #include #include int main() { int i, n; printf("enter length of your employee id : "); scanf("%d", &n); char *ptr; ptr = (char *)calloc(n, sizeof(char)); for (i = 1; i
@nownow1025
@nownow1025 Жыл бұрын
Why showing wrong output. i am trying it but output is wrong? whats wrong in the code?
@krittikaabarman__
@krittikaabarman__ 2 ай бұрын
Same i have tried why it is coming program 1.exe has stopped working
@ritankarmondal8707
@ritankarmondal8707 5 ай бұрын
#challenge accepted: #include #include int main(){ char* empID; empID = (char*)calloc(1,sizeof(char)); for (int i = 0; i < 3; i++) { int n; printf("Employee %d ",(i+1)); printf("Enter the number of characters of your id: "); scanf("%d",&n); empID = (char*)realloc(empID,(n+1)*sizeof(char)); char ch= getchar(); printf("Enter your Employee id: "); gets(empID); printf("Your employee id is : %s ",empID); } free(empID); return 0; }
@devprakash6608
@devprakash6608 2 жыл бұрын
#include #include #include int main() { int n,i; char *arr; for (i = 1; i < 4; i++) { first: printf(" Employee %d: ", i); printf(" Enter the numbe of characters in the eID: "); scanf("%d", &n); arr = (char *)malloc(n * sizeof(char)); printf(" Enter your eID: "); scanf("%s", arr); if (strlen(arr) == n) printf(" Your eID is: %s", arr); else { printf(" Your id is invalid. "); goto first; } free(arr); } return 0; }
@oxygen632
@oxygen632 Жыл бұрын
#include #include #include int main() { int k, j, n; printf("ABC pvt ltd. "); //employee 1// printf("enter the no of charecters of id of employee1:-\t"); scanf("%d",&n); char*ptr; ptr=(char*)malloc((n+1)*sizeof(char)); printf("enter the employee id "); scanf("%s",&(*ptr)); printf("employee id of first employee is\t"); puts(ptr); //employee 2// printf("enter the no of charecters of id of employee2:-\t"); scanf("%d",&j); ptr=(char*)realloc(ptr, (j+1)*sizeof(char)); printf("enter the employee id "); scanf("%s",&(*ptr)); printf("employee id of second employee is\t"); puts(ptr); //employee 3// printf("enter the no of charecters of id of employee3:-\t"); scanf("%d",&k); ptr=(char*)realloc(ptr, (k+1)*sizeof(char)); printf("enter the employee id "); scanf("%s",&(*ptr)); printf("employee id of second employee is\t"); puts(ptr); free(ptr); return 0; }
@tejastaradgaonkar3622
@tejastaradgaonkar3622 2 жыл бұрын
#include #include int main() { int q; printf("Enter no of employee you want to take record of "); scanf("%d", &q); int num[q]; for (size_t i = 0; i < q; i++) { printf("Employee: %d ",i+1); printf("Enter no of characters in your eId "); int n; scanf("%d", &n); printf("Enter your eId "); char *employee[n]; employee[n] = (char *)calloc(n, sizeof(char)); scanf("%s", &employ); printf("Your eId is: %s ", employ); printf(" "); free(employee); } return 0; }
@xarrnooc4679
@xarrnooc4679 Жыл бұрын
#include #include #include int main() { char *eid; int n; for (int i = 1; i < 4; i++) { printf("Please enter your employee ids length:- "); scanf("%d", &n); eid = (char *)malloc(n * sizeof(char)); scan: printf("Employee %d please enter your empolyee id:- ", i); scanf("%s", eid); if (strlen(eid) == n) { printf("Yor Employee id is:- %s ", eid); free(eid); } else { printf("You have entred worng input please try again "); goto scan; } } return 0; }
@ankur__x18
@ankur__x18 9 ай бұрын
#include #include int main() { char *ptr; int l; for (int e = 1; e < 4; e++) { printf(" employee %d enter no of characters in your ID: ", e); scanf("%d", &l); ptr = (char *)calloc(l, sizeof(char)); printf(" employee %d enter your ID:", e); for (int c = 0; c < l; c++) { scanf(" %c", &ptr[c]); } printf(" employee %d id = %s", e, ptr); printf(" "); } return 0; }
@piyushsoni7495
@piyushsoni7495 Жыл бұрын
done #include #include int main() { int *ptr; int n; printf("Enter the number in your eID: "); scanf("%d", &n); ptr = (int *)malloc(n * sizeof(int)); for (int i = 0; i < 3; i++) { printf("The eID of Employee %d is ", i); scanf("%d", &ptr[i]); } for (int i = 0; i < 3; i++) { printf("The eID of employee %d is %d ", i, ptr[i]); } return 0; }
@ythashtagms2139
@ythashtagms2139 11 ай бұрын
#include #include int main() { // Dynamic Memory Allocation int employee; char *ptr; int n = 3; for (int i = 0; i < n; i++) { printf("Enter the length of Employee Id "); scanf("%d", &employee); ptr = (char*) calloc (employee,sizeof(char)); printf("Enter the Employee Id "); scanf("%s" , &(*ptr)); if (strlen(ptr)== employee) { printf("The Employee id of first Employee is :" ); for (int i = 0; i < employee; i++) { printf("%c" , ptr[i]); } printf(" "); } else { printf("Sorry invalid input of Employee id given "); } } return 0; }
@harmankaur3938
@harmankaur3938 2 жыл бұрын
Author:Harman #include #include int main() { int l, count; char *p; printf("Enter the no of EID's of employees you want to record in abc pvt. lmd "); scanf("%d", &count); for (int j = 0; j < count; j++) { printf("Enter the no of character of id of employee%d ID ", j + 1); scanf("%d", &l); p = (char *)calloc(l, sizeof(char)); printf("Enter the eid of employee%d ", j + 1); for (int i = 0; i
@SwarnadipDutta
@SwarnadipDutta 5 ай бұрын
#include #include int main() { int n; char *ID; printf("Welcome to employee management ABC pvt ltd "); for(int i = 0; i < 3 ; i++) { printf("Employee no.%d " , i+1); printf("\tEnter ID length : "); scanf("%d" , &n); ID = (char *) realloc(ID , (n+1)*sizeof(int)); printf("\tEnter ID : "); scanf("%s" , ID); printf("\tEntered ID : "); puts(ID); printf(" "); } free(ID); return 0; }
@vaibhavpuri584
@vaibhavpuri584 3 жыл бұрын
Love you bhai 🥰🔥
@vaibhavpuri584
@vaibhavpuri584 3 жыл бұрын
Love you bhai 🥰
@AmanSingh-yy4fn
@AmanSingh-yy4fn 3 жыл бұрын
Challenge accepted
@deepmahanta9376
@deepmahanta9376 5 ай бұрын
#include #include int main() { for(int i = 0; i
@vaibhavpuri584
@vaibhavpuri584 3 жыл бұрын
Love you bhai 🥰🔥
@vaibhavpuri584
@vaibhavpuri584 3 жыл бұрын
Love you bhai 🥰
@vedantalone1772
@vedantalone1772 Жыл бұрын
Challenge accepted
@vaibhavpuri584
@vaibhavpuri584 3 жыл бұрын
Love you bhai 🥰🔥
@vaibhavpuri584
@vaibhavpuri584 3 жыл бұрын
Love you bhai 🥰🔥🔥🙃
@vaibhavpuri584
@vaibhavpuri584 3 жыл бұрын
Love you bhai 🥰
@vaibhavpuri584
@vaibhavpuri584 3 жыл бұрын
Love you bhai 🥰🔥🔥🔥🙃
@vaibhavpuri584
@vaibhavpuri584 3 жыл бұрын
Love you bhai 🥰🔥🔥🔥
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Pointers In C: C Tutorial In Hindi #26
32:46
CodeWithHarry
Рет қаралды 828 М.
Structures In C: C Tutorial In Hindi #37
26:18
CodeWithHarry
Рет қаралды 506 М.
Function Pointers In C: C Tutorial In Hindi #72
18:23
CodeWithHarry
Рет қаралды 89 М.
Arrays And Pointer Arithmetic In C: C Tutorial In Hindi #27
28:32
CodeWithHarry
Рет қаралды 477 М.
Call by Value & Call By Reference In C: C Tutorial In Hindi #31
27:30
CodeWithHarry
Рет қаралды 373 М.
#define and #include Preprocessor Directives: C Tutorial In Hindi #59
19:37
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 334 М.
C Pre-processor Introduction & Working: C Tutorial In Hindi #58
12:44
CodeWithHarry
Рет қаралды 111 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН