Posts

Showing posts with the label string function

STRING FUNCTION

  C supports a wide range of functions that manipulate null-terminated strings-    1.CHECK MOBILE NUMBER IS CORRECT                              OR NOT:  #include<stdio.h> #include<string.h> int main() { char mn[200]; printf("Enter mobile number\n"); gets(mn); if(strlen(mn)==10) printf("Number is correct"); else printf("Incorrect Number"); } •OUTPUT  Enter mobile number  9678513240 Mobile number is correct.     2.LOGIN PROGRAMME USING STRING: #include<stdio.h> #include<string.h> int main() { char u[200]="easy@gmail.com",p[200]="ani@789"; char u1[200],p1[200]; printf("Enter username\n"); gets(u1); printf("Enter password\n"); gets(p1); if(strcmp(u,u1)==0&&strcmp(p,p1)==0) printf("Login Successfully"); else printf("Wrong username or password"); } •Output  Enter username  Easy@gmail.com  Enter password  Sand@123 Login succe...

Wanna Know what is c?

Image
                     ☆INTRODUCTION  •WHAT IS C ? C is general-purpose, high level language  that was initially developed by Dennis Ritchie between 1969 and 1973  at BELL LABS . He was greatest computer scientist . It was created from “ALGOL”, “BCL”  and “B” programming languages.  'C' is a powerful programming language which is strongly associated with the UNIX operating system.    Even most of the UNIX operating system is coded in 'C'. Initially 'C' programming was limited to the UNIX operating system, but as it started spreading around the world, it became commercial, and many compilers were released for cross-platform systems.            Today 'C' runs under a variety of operating systems and hardware platforms. As it started evolving many different versions of the language were released. At times it became difficult for the developers to keep up with the latest ver...