Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Atoi without minus
//gcc 5.4.0 #include <stdio.h> #include<stdlib.h> int myatoi(char *str) { int res=0; int i=0; int sign=1; if(str[0]=='-') { sign=-1; i++; } for(i=0;str[i]!='\0';++i) res=res*10+str[i]-'0'; return res*sign; } int main () { char str1[ ]="6"; char str2[ ]="5"; int number1=myatoi(str1); int number2=myatoi(str2); printf("%d\t%d\n",number1, number2); printf("%d",number1*number2); return 0; }
run
|
edit
|
history
|
help
0
fibonacci 1
FizzBuzz
FUNTION4
Project 5 v.08
Star1..3
Link List
función free()
First program.c
mod 4
Función bsearch