I think you should get the best coder award on youtube.
@codewithharryfanchannel5595 жыл бұрын
Best l. I. Tian. I agree with you
@AnkitKumar-zm1dj3 жыл бұрын
I agree
@Marcoo_Editz2 жыл бұрын
the best coding teacher you can say.
@vaibhavbhardwaj485 жыл бұрын
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.59572 жыл бұрын
#challane accepted I am very excited for this challange i must do my best to solve the problem
@beyondzetabyte5 жыл бұрын
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_tanwar4 жыл бұрын
Yes this is very helpful course..
@raghavgupta31685 жыл бұрын
Harry bhai you are helping us alot. Now, please teach Data Structures aur Algorithms for Product Based Companies. Please-Please🙏🙏
@RohanDasRD5 жыл бұрын
Bhai Ai With Ml Daalo!
@Chirag_Sharma_3 жыл бұрын
you and your course is the best sir!
@rrcreation59345 жыл бұрын
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 Жыл бұрын
Same bhai idhr bhi
@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 Жыл бұрын
❤
@ballapranavachaitanya397511 ай бұрын
thanks a lot very helpful
@LPUEDITS7 ай бұрын
bhen free to kar leti calloc ko
@mrinmoydeka12324 ай бұрын
realloc vhi use karna tha...
@bismage694 ай бұрын
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)
@girishingale42734 жыл бұрын
I love you 300 haryy bhai! 300th like! And also challenge accepted!
@ayanavadas61543 жыл бұрын
Yes the questions are good and do give questions.
@royfamily92732 жыл бұрын
Baria course hai Harry Bhaiya.
@barunjena61714 жыл бұрын
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?
@moveonvillain10803 жыл бұрын
it simply rewrites the memory
@nishatmunshi46722 жыл бұрын
you should free the memory first before leaving one cycle of the loop
@vaibhavpuri5843 жыл бұрын
Love you bhai 🥰🔥🔥
@royfamily92732 жыл бұрын
Thanks Harry Bhaiya
@zamankhan12555 жыл бұрын
harry bhai node js pe videos banao
@arjunsonani78755 жыл бұрын
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?????
@sanjanakeshri45984 жыл бұрын
Thanks sir , I really learned it ☺😘
@allenhuntsman Жыл бұрын
Chummi kyu de rhi h bhai
@iloveiit70405 жыл бұрын
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
@shubhamjaiswal23225 жыл бұрын
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.
@iloveiit70405 жыл бұрын
@@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
@shubhamjaiswal23225 жыл бұрын
@@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
@anantgupta11883 жыл бұрын
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Ай бұрын
Sir please upload a Ai, ML based course
@engineerbhai76425 жыл бұрын
BestC tutorials in you tube
@erdevkumar77 ай бұрын
Nice series
@oneplusoneeleven75505 жыл бұрын
Ik video nexpos rapid 7 please
@codewithharryfanchannel5595 жыл бұрын
Best coder in India.
@user-wm3sp6uu3g Жыл бұрын
Challenge accepted🔥🔥
@himanshushukla53562 жыл бұрын
thanks
@smartapplications55174 жыл бұрын
Best codyuber
@awdheshthakur70093 жыл бұрын
Bhai please make video on swift language
@krishmehta54185 жыл бұрын
can I use code blocks
@NickName-fz7jk5 жыл бұрын
Hii sir please start c# course
@krishmehta54185 жыл бұрын
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
@anotech44112 жыл бұрын
you need to in put mingw compiler file in it
@rajurajesh-c3f Жыл бұрын
Completed !!! #include #include int main(){ printf("\t\t\t "); char* ptr; int size; for(int i=0;i
@krishmehta54185 жыл бұрын
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
@kuldeepgaur22724 жыл бұрын
hi would you resolve it??
@kuldeepgaur22724 жыл бұрын
if not email me kuldeep9754040979@gmail.com
@legendarychest16305 жыл бұрын
/*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; }
@barunjena61714 жыл бұрын
Does your string take input as both letters and digits?
@eldrago31403 жыл бұрын
@@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.
@tsbgaming57703 жыл бұрын
Bro ye sacnf me &ptr kyu nahi lagya sirf ptr kyu lagya
@Sunny-qy1fj2 жыл бұрын
@The Hustlers bhai par isne #include bhi declared nhi kiya
@Sunny-qy1fj2 жыл бұрын
@The Hustlers ok bro thanks
@rivines3 жыл бұрын
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
@amandayal54103 жыл бұрын
Exactly same problem with my code
@ayushkumarmehta53363 жыл бұрын
Yaa, that's my doubt too.
@shubhamshukla1342 жыл бұрын
use if else condition
@stack_of_knowledge2 жыл бұрын
#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; }
@karthikramesh45733 жыл бұрын
Printf(" Challenge accepted ");
@hlgff62999 ай бұрын
P should be small printf
@nishviral7995 жыл бұрын
Bhai help how to fix pyaudio not installing problem in python
@CREePeR-2112 жыл бұрын
harry bhai lofic buildibg mai problen aa rahi hai
@kikubakery63684 жыл бұрын
Op sir
@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
@nishviral7995 жыл бұрын
It's say portaudio.h not found
@krishmehta54185 жыл бұрын
please help me installing gcc compiler in vs after seeing your tut 10 time and working on it
@SoaibAslamOfficial2 жыл бұрын
Soaib aslam
@blockchaindaily23483 жыл бұрын
१ अपृल,२०२१; 1,April 2021;
@kibriahasan40574 жыл бұрын
সব ভিডিও গুলো বাংলা ভার্সন (ডাবিং) বা বাংলা ভাষায় বের করেন ভাই।
@sb_infi3 жыл бұрын
Tumi kibhabe jano uni bangali
@kibriahasan40573 жыл бұрын
@@sb_infi kno??????
@kibriahasan40573 жыл бұрын
@@sb_infi kno??????
@sb_infi3 жыл бұрын
@@kibriahasan4057 Ami khali jigesh korechilam..
@rishabhgoyal72493 жыл бұрын
Challenge accepted!
@balramnaik3705 ай бұрын
#include #include int main(int argc, char *argv[]) { int*ptr,length,i,n=3; for(i=1;i
@jaypatel93924 жыл бұрын
Challenge accepted
@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 Жыл бұрын
#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_076 ай бұрын
09-06-24
@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-up3mb3 жыл бұрын
challenge accepted
@mahendrajain67523 жыл бұрын
Challenge accept
@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 Жыл бұрын
#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
@hwaiting35733 жыл бұрын
Challenge Accepted
@SourashmiDas Жыл бұрын
sorry this was exercise no-11
@kavyagupta_32323 жыл бұрын
Challenge Accepted Edit - Mission accomplished Code in reply 🌟
@moveonvillain10803 жыл бұрын
Were you able to solve the problem yet?
@MizanurRahaman034 жыл бұрын
//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
@mizanmulani65632 жыл бұрын
same name
@MizanurRahaman032 жыл бұрын
@@mizanmulani6563 😂😂😂😂
@chemision16305 жыл бұрын
Bhai aaj tu bata hi Deeh ki tu Hindi Gaming Zone Chennle Par Video Dalega Ya Nahi 😡😡😡😠😠😠
@bhuvandahal4212 жыл бұрын
//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(); }
@bismage694 ай бұрын
(#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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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
@--kakashi2 жыл бұрын
#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 Жыл бұрын
#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; }
@manoor08585 ай бұрын
#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; } } }
@nishatmunshi46722 жыл бұрын
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; } } }
@cocclashingclashoftitans11562 жыл бұрын
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 Жыл бұрын
#include #include #include int main() { int n; char *eID; for(int i=0;i
@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; }
@funhourswithyash9 ай бұрын
#include #include int main(){ char* ptr; int a; for (int i=1;i
@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)
@vikustorm34112 жыл бұрын
#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
@chitranshigupta99006 ай бұрын
#include #include int main() { char *eid; int length; for (int i=1; i
@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 Жыл бұрын
Why showing wrong output. i am trying it but output is wrong? whats wrong in the code?
@krittikaabarman__2 ай бұрын
Same i have tried why it is coming program 1.exe has stopped working
@ritankarmondal87075 ай бұрын
#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; }
@devprakash66082 жыл бұрын
#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 Жыл бұрын
#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; }
@tejastaradgaonkar36222 жыл бұрын
#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 Жыл бұрын
#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__x189 ай бұрын
#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 Жыл бұрын
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; }
@ythashtagms213911 ай бұрын
#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; }
@harmankaur39382 жыл бұрын
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
@SwarnadipDutta5 ай бұрын
#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; }