File tree Expand file tree Collapse file tree 3 files changed +45
-19
lines changed Expand file tree Collapse file tree 3 files changed +45
-19
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "files.associations" : {
3+ "stdio.h" : " c"
4+ }
5+ }
Original file line number Diff line number Diff line change 7474// }
7575// 👉👉 🔹🔹 question 4️⃣ take a string input from the user using %c
7676
77- #include <stdio.h>
78- int main (){
79- char srt [15 ];
80- char ch ;
81- int i = 0 ;
82- while (ch != '\n' )
83- {
84- scanf ("%c" , & ch );
85- srt [i ] = ch ;
86- i ++ ;
87- }
88- srt [i ] = '\0' ;
89- puts (srt );
77+ // #include <stdio.h>
78+ // int main(){
79+ // char srt[15];
80+ // char ch;
81+ // int i = 0;
82+ // while (ch != '\n')
83+ // {
84+ // scanf("%c" , &ch);
85+ // srt[i] = ch;
86+ // i++;
87+ // }
88+ // srt[i] = '\0';
89+ // puts(srt);
9090
91- return 0 ;
92- }
91+ // return 0;
92+ // }
9393
9494// #include <stdio.h>
9595// int main(){
@@ -108,8 +108,29 @@ puts(srt);
108108// return 0;
109109// }
110110
111- // #include <stdio.h>
112- // int main(){
113- // return 0;
114- // }
111+
112+ // |🌟 ✨| salting
113+
114+ // // 👉👉 🔹🔹 question 5️⃣ find the salted from a password entered by the user
115+ // if the salt "123" & added that the end
116+
117+ #include <stdio.h>
118+ #include <string.h>
119+ void salting (char password []);
120+ int main (){
121+ char password [100 ] ;
122+ scanf ("%s" , password );
123+ salting (password ) ;
124+
125+ return 0 ;
126+ }
127+ void salting (char password []){
128+ char salt [] = "123 " ;
129+ char newPass [200 ];
130+ strcpy (newPass , password ); // newPass = something
131+ strcat ( newPass , salt ); // new pass = something + 123 || strcat = +
132+ puts (newPass );
133+
134+
135+ }
115136// 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ 6️⃣ 7️⃣ 8️⃣ 9️⃣ 🔟
You can’t perform that action at this time.
0 commit comments