How can I create a login system in C?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

You can download the videos from Youtube
Comments

main() { int i,counter=0,flag=0; char uid,pwd,s_uid={"11user1","12user2","13user3"}; char s_pwd={"Pwd1","Pwd2","Pwd3"},ch='a';/*dummy character in ch */ clrscr(); printf("\n Enter the user id : "); scanf("%s",uid); printf("\n Enter the password : "); i=0; while(1) { ch=getch(); if(ch==13) break; else...
read more
main() { int i,counter=0,flag=0; char uid[25],pwd[25],s_uid[][25]={"11user1","12user2","13user3"}; char s_pwd[][25]={"Pwd1","Pwd2","Pwd3"},ch='a';/*dummy character in ch */ clrscr(); printf("\n Enter the user id : "); scanf("%s",uid); printf("\n Enter the password : "); i=0; while(1) { ch=getch(); if(ch==13) break; else if(ch==8) { if(i!=0) /*this is for avoiding the ENTER instructions getting deleted */ { printf("\b"); /*printing backspace to move cursor 1 pos back*/ printf("%c",32);/*making the char invisible which is already on console*/ printf("\b"); /*printing backspace to move cursor 1 pos back*/ i--; pwd[i]='\0'; } else continue; } else { putchar('*');/* char - '*' will be printed instead of the character */ pwd[i]=ch; i++; } } pwd[i]='\0'; for(i=0;i<=2;i++) { if((stricmp(uid,s_uid[i]))==0 && (strcmp(pwd,s_pwd[i]))==0) { flag=1; break; } } if(flag) printf(" \n \n \t \t USER AUTHENTICATED "); else printf("\n \n \n\t TRESSPASSERS WILL BE SHOT AND SURVIVORS WILL BE SHOT AGAIN .. ha ha :)"); printf("written by dileep basam .. [snipped email]"); getch(); } read less
Comments

Related Questions

How can I improve my C language skills so that if anyone asks me any questions about C, I can have the answer to those particular questions?
There are types of questions asked in this sector. 1.Related to Syntax and theoretical. For this you have to have a sound knowledge of the language. 2.Related to programming and output's. For this...
Furqankhan
0 0
5
Why is C still so popular?
C is often taught as an introductory programming language in computer science courses due to its simplicity and close-to-the-hardware nature. This ensures a continuous influx of developers familiar with...
Chitra
0 0
5
The object file is in binary code, and the machine understands the binary language. So why object files are not executed?
Object files are sources compiled into binary machine language, but they do not have library files, so they are not executed.
Dhruvil
0 0
9
How do you print an address?
int main(){ int a=5; printf("Address of variable a is: %d",&a); return 0; }
Prakash
2 0
6
Which is the best C language IDE/compiler for Windows?
For Windows, the best C compiler often depends on specific needs and preferences, but MinGW (with GCC) and Microsoft Visual C++ (MSVC) are frequently cited as top choices. MinGW provides a free, open-source...
Alimasi
0 0
6

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

All About Programming And A Good Programmer.
Hi, This is my first lesson for you guys. Hope you enjoy reading it. In recent community questions, I found many people wanted to be good programmers, or wanted to have good hands on certain language,...

Bit wise operators in C
Bit Wise Operators Bit Wise operators are manipulates of individual bits with in a word of memory. The bit wise operators can be divided in to three general category. One’s Complement...

Find out the Output of the following with reason and get C Language Training fess less by 10%
1. void main() { clrscr(); printf(5+"Beautifull"); getch(); } 2. void main() { int a=50; clrscr(); ...

Introduction to Programming Languages
What is a Programming Language? A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages...

Java and C trainer
Always think any conspect with real-time example like Object -- object must have states and behaviour then only we will call that thing is Object like fan is Object (rotating,color)

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you