Note: while using scanf, ensure that the function does not take character inputs more than one less than the character array. Here, you allocated size a[100], so in scanf, you should write: scanf("%99s",&a); Where, 99 denotes the first 99 characters to be taken as input at max and the characters following 99th character will be automatically discarded. Note that I told 99 characters because character array should also contain "\0"
Employee Data base #include #include #include #include #define MAX 100 typedef struct employee { int id; char name[20]; int age; }emp; emp e[MAX]; int n; void create(); void display(); void modify(); void append(); void search(); void sort(); int main() { int choice; while(1) { printf(" 1.Create 2.Display 3.Modify 4.Append 5.Search 6.Sort 7.EXIT"); printf(" Enter Your Choice:"); scanf("%d",&choice); switch (choice) { case 1:create(); break; case 2:display(); break; case 3:modify(); break; case 4:append(); break; case 5:search(); break; case 6:sort(); break; default:exit(0); } } getch(); } void create() { int i; printf("Enter The No. of New Records to Be Created:"); scanf("%d",&n); for(i=0;i
@@arhamkhan6817 youtube videos and books. I will recommend Portfolio Course followed by Code with Harry channels For books, I will recommend "The C Programming Language" by Dennis Ritchie and Brian Kernighan. Ritchie and Ken Thompson were the inventors of the language, so the best thing is to read what the inventors themselves have to say about the language. Also, there are manuals about standard C library in GNU or GCC official website I don't remember. You can read many things from the files available in the website as well
Sir please please please reply Sir mujhe print karna hai 12345 and 54321 but ye 1(for) ke under likhna he single for loop please make this program output 12345 and 54321
Yes because a[100] ek string hai jo ki character array hai or character array ek pointer bhi hota hai So is hisab se s string ek pointer hua usme & ke bina bhi program kam krega.
It’s a C thing. Other languages use a different approach (for example Java) and do use a void function as their main with a separate function to exit with a specific code.
#include #define LEN 256 int main () { FILE * fp; int i; /* open the file for writing*/ fp = fopen ("E:\mk.txt","w"); /* write 10 lines of text into the file stream*/ for(i = 0; i < 10;i++){ fprintf (fp, "This is line %d ",i + 1); } /* close the file*/ fclose (fp); return 0; }
youre a king for coding on mobile lmao
#include
#define MAXCHAR 1000
int main() {
FILE *fp;
char str[MAXCHAR];
char* filename = "E:\mk.txt";
fp = fopen(filename, "r");
if (fp == NULL){
printf("Could not open file %s",filename);
return 1;
}
while (fgets(str, MAXCHAR, fp) != NULL)
printf("%s", str);
fclose(fp);
return 0;
}
@RexIsW509 ich if u need 10k lines for a py game ur a bad programmer
@@user-bn2jl4fk3f
extern GetStdHandle
extern WriteFile
extern ExitProcess
section .rodata
msg db “you’re monkey”, 0x0d, 0x0a
msg_len equ $-msg
stdout_query equ -11
section .data
stdout dw 0
bytes_written dw 0
section .text
global start
start:
mov rcx, stdout_query
call GetStdHandle
mov rcx, msg
mov r8, msg_len
mov r9, bytes_written
push qword 0
call WriteFile
xor rcx, rcx
call ExitProcess
In python> for i in range('...')
print('text')
Nah it would be
name = input("Enter your Name")
for i in range (100):
print(name)
still python is so much simpler than C
Note: while using scanf, ensure that the function does not take character inputs more than one less than the character array.
Here, you allocated size a[100], so in scanf, you should write: scanf("%99s",&a);
Where, 99 denotes the first 99 characters to be taken as input at max and the characters following 99th character will be automatically discarded. Note that I told 99 characters because character array should also contain "\0"
Employee Data base
#include
#include
#include
#include
#define MAX 100
typedef struct employee
{
int id;
char name[20];
int age;
}emp;
emp e[MAX];
int n;
void create();
void display();
void modify();
void append();
void search();
void sort();
int main()
{
int choice;
while(1)
{
printf("
1.Create
2.Display
3.Modify
4.Append
5.Search
6.Sort
7.EXIT");
printf("
Enter Your Choice:");
scanf("%d",&choice);
switch (choice)
{
case 1:create();
break;
case 2:display();
break;
case 3:modify();
break;
case 4:append();
break;
case 5:search();
break;
case 6:sort();
break;
default:exit(0);
}
}
getch();
}
void create()
{
int i;
printf("Enter The No. of New Records to Be Created:");
scanf("%d",&n);
for(i=0;i
Bhai c language online kaha sikhr
@@arhamkhan6817 youtube videos and books. I will recommend Portfolio Course followed by Code with Harry channels
For books, I will recommend "The C Programming Language" by Dennis Ritchie and Brian Kernighan. Ritchie and Ken Thompson were the inventors of the language, so the best thing is to read what the inventors themselves have to say about the language. Also, there are manuals about standard C library in GNU or GCC official website I don't remember. You can read many things from the files available in the website as well
Thats because /0 is the null value at the beginning of a string correct
@@ZeekerDogthe null byte us at the end of an string
How many of them are want to this coding is only in computer 😂
Bhai itna lamba code kyu likh rhe ho short. #include
int main(){
for(int i=0;i
Yadi kisi aur se uskaa naam likhwaana hai to?
Variable is fixed in ur case where as the variable is user defined in the video
Error i not deared
@@Shin_ChanOO7 string store krwade and usko print krwade
Impressive ❤
I love Telugu girl❤
Thts why i love python😢
Thanks bro❤️
you can use for loop for that in c language
It's really working bro thx
Which app
nice
💛jesus is true God believe me💛
Stupid get some work
//string without ptr 😅
#include
#include
#include
int str_length(char[]);
void str_copy(char[], char[]);
void str_rev(char[], char[]);
int str_cmp(char[], char[]);
void str_substr(char[], char[]);
void str_cat(char[], char[]);
int main() {
char str1[50], str2[50], str3[50];
int len, choice, flag;
printf("Enter Choice 1-Length, 2-Copy, 3-Reverse, 4-Compare, 5-Substring, 6-Palindrome, 7-Concatenation
");
printf("Enter choice
");
scanf("%d", &choice);
switch (choice) {
case 1:
printf("Enter first string
");
scanf("%s", str1);
len = str_length(str1);
printf("Length of string is = %d
", len);
break;
case 2:
printf("Enter first string
");
scanf("%s", str1);
str_copy(str2, str1);
printf("Copied string is = %s
", str2);
break;
case 3:
printf("Enter first string
");
scanf("%s", str1);
str_rev(str2, str1);
printf("Reversed string is = %s
", str2);
break;
case 4:
printf("Enter first string
");
scanf("%s", str1);
printf("Enter second string
");
scanf("%s", str2);
flag = str_cmp(str1, str2);
if (flag == 0)
printf("Both strings are equal
");
else
printf("Both strings are not equal
");
break;
case 5:
printf("Enter first string
");
scanf("%s", str1);
str_substr(str1, str2);
break;
case 6:
printf("Enter first string
");
scanf("%s", str1);
str_copy(str2, str1);
str_rev(str3, str1);
if (strcmp(str2, str3) == 0)
printf("The string is palindrome
");
else
printf("The string is not palindrome
");
break;
case 7:
printf("Enter first string
");
scanf("%s", str1);
printf("Enter second string
");
scanf("%s", str2);
str_cat(str1, str2);
printf("Concatenated string is = %s
", str1);
break;
}
return 0;
}
int str_length(char str1[]) {
return strlen(str1);
}
void str_copy(char str2[], char str1[]) {
strcpy(str2, str1);
}
void str_rev(char str2[], char str1[]) {
int len = strlen(str1);
for (int i = 0; i < len; i++) {
str2[i] = str1[len - i - 1];
}
str2[len] = '\0';
}
int str_cmp(char str1[], char str2[]) {
return strcmp(str1, str2);
}
void str_substr(char str1[], char str2[]) {
int position;
printf("Enter position=");
scanf("%d", &position);
strncpy(str2, str1 + position, strlen(str1) - position);
str2[strlen(str1) - position] = '\0';
printf("Substring is %s
", str2);
}
void str_cat(char str1[], char str2[]) {
strcat(str1, str2);
}
Oh my god you awesome guy
But your not declare in switch statement "default"😢😢
@@localcriminalboys3885 copy paste bro 😂😂😂😂😂
Sir please please please reply
Sir mujhe print karna hai 12345 and 54321 but ye 1(for) ke under likhna he single for loop please make this program output 12345 and 54321
Sir kitna bar name print karna oh number type kar aap print karo
Hey guys there is no
so everything will be in a single line right😮
Bhai AP ny enter name likhny k bd Kis button ko press kia h
It's not working
?
There is an error
Yo have u added this header
#include
No he did not include,(&) symbol in scanf
Static storage classes
100character 100 name print f me Naam Dala
For loop lagaya boom❤lovely
Hi sir
Aap phone par program kis app or website kar kar rahai ho please tell me
How to change name in the programming hub
Bro
Its very easy not to use string for this .
#include
int main()
{
for(int i=0;i
Music is giving me ear cancer
How to give delay
❤
C is a procedural language that provides no support for objects and classes. C++ is a combination of OOP and procedural programming languages.
You can still create them in c it just takes more work an knowledge
Where is ampersand(&) in scanf() 🤔
In string it is not used
❤❤
Where is '&' in scanf😅
Charactere kae jagh stirng kha se bhai
I need think website link bro
is editor ka naam kyaa hai
How do you download please show me
Error scanf("%s", &a); & missing😂
What is the mean of \t in for loop
Tap space
Bhai meraa name kaise detect kar liya yar
Anna super anna
Nuv naak nacchav anna
🎉🎉❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤
Which app uesing you?
Online C compiler on Google chrome.
%c is included
Suggest me the best app for C language
Is it possible on mobile...?
The song is an atrocity man please remove it please....
Bhai scanf mai (&) nahi lgaya
Bro link?
App Name
< why we using this symbol?
How to do this in Android
I don't get my name many times as your
Later on I get it but it's amazing I'm learning coding too but now there are exams so I quit for some time after all it's final exam
How will take a
Bro i got compiling error
doesnt
100 times name varala
App name tell bro
Online C compiler on Google chrome
Python write it's just 2 lines
your name is aditya
Python
Print( "Enter the name:")
The BGM IS irritating
Python made easier that is print(name*100) simple😂😂
Using loop would have make it easier
But usne to loop use kiya hi hai.🙄
App name please 🥺🥺
C coding ❤
Enter your name😂
6&7 line galat hai
Broo what is mean by %s
Percent s
Its the format specifier for a string
Kam hi nahi kar raha hai
Not working
& likhe bina run hua😂😂😂
Yes because a[100] ek string hai jo ki character array hai or character array ek pointer bhi hota hai
So is hisab se s string ek pointer hua usme & ke bina bhi program kam krega.
What if I don't write return 0
Just write void main() in place of int main()
It’s a C thing. Other languages use a different approach (for example Java) and do use a void function as their main with a separate function to exit with a specific code.
If you don't write return 0 it's completely okey. Return 0 means that we expecting code to finish executing himself.
App name
C coding
Online C compiler on Google chrome
Folks please this is not in mobile
Is he coding using a phone
Ohaper ,"&" nahi dala, scanf me
Ha main bhi ohi soch raha tha
if i don't write & in scanf is it okay or not?
It's a addressing sentence you should write
What is the function of \ t
It inserts whitespace and moves the cursor. Sort of like creating another column visually
@@pbmaic3291yes but no, its just for a tab charactet
Mo np ril
scanf laa & podala...?
It also my doubt
String type variables ku & poda vendam
It's wrong 'i' should not be equal to 100 as 'a' will go upto 99 only
he is right
Ampersand a vee podalayam.. aprm epdi bruh a la poi name store aagum.... 🤡 Code error debugged by compiler itself
String type ku ampersand use pana vendam
Print("name"*100)
you cant multiply a string by a int
@@easyrobloxcodingyou can in python
App name???
C coding
Mo
Bro app name
C coding on play Store
Online C compiler on Google chrome
The worst bgm 😢
Nth mey mro kdyh mot my dj
Which app is this?
Programiz a webpage
Afj hi mto wi ei mp
#include
int main()
{
int i;
for (i=0;i
I was also about to say the exact thing😅
where is user input bro in your code?
@@xd9665its not necessary here,you know your name ,right ?
#include
int main()
{
int i;
for(i=0;i
#include
#define LEN 256
int main ()
{
FILE * fp;
int i;
/* open the file for writing*/
fp = fopen ("E:\mk.txt","w");
/* write 10 lines of text into the file stream*/
for(i = 0; i < 10;i++){
fprintf (fp, "This is line %d
",i + 1);
}
/* close the file*/
fclose (fp);
return 0;
}
#include
#define MAXCHAR 1000
int main() {
FILE *fp;
char str[MAXCHAR];
char* filename = "E:\mk.txt";
fp = fopen(filename, "r");
if (fp == NULL){
printf("Could not open file %s",filename);
return 1;
}
while (fgets(str, MAXCHAR, fp) != NULL)
printf("%s", str);
fclose(fp);
return 0;
}
Is that web site is for free
That's aslo works
#include
int main ()
{
int i;
char a[100];
printf("Enter Your Name : ");
scanf("%s", a);
for(i= 1;i
It's not working
App name??
Website hai brother
coding c