Guest User

new_code

a guest
Apr 9th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.76 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<windows.h>
  3. #include<pthread.h>
  4. #include<conio.h>
  5. #include<string.h>
  6. #include<graphics.h>
  7. #include<time.h>
  8. #define space "\t \t \t"
  9. static int up_price=0;
  10. static int ind_pos=0;
  11. typedef struct list
  12. {
  13. char name[100];
  14. int start_price;
  15. int volume;
  16. int market;
  17. } list_t;
  18. void check_null();
  19. void fun_graph(int *data,int len,int st_price);
  20. int* whole_data(int st_price,int page,int CURRENT,int *length);
  21. int char_to_int(char*num);
  22. void graph_section(char *name,int shares,int st_price,int page,int CURRENT);
  23. void fun(int exp,int act);
  24. void inserting_the_data(list_t *collect,char*Data,int prev,int cur,int range);
  25. int Main_page();
  26. void insert(list_t *collect,char *Data,int pos);
  27. void view_stock(list_t*Data,int current,int page);
  28. void inserting_the_data(list_t *collect,char*Data,int prev,int cur,int range);
  29. void portfolio(char *Name);
  30. void my_Account(char *Name);
  31. void watch_list(char* Name);
  32. void stock_list(char *Name);
  33. void user_choice(int choice,char *Name);
  34. void trans_sec(char* Name);
  35. void updating_point();
  36. void userpage(char *users);
  37. char *int_char(int src);
  38. void *myThreadFun(void *id);
  39. int array[20]= {0};
  40. void *myThreadFun(void *id)
  41. {
  42. FILE * fp_3=fopen("Prices_list.txt","a+");
  43. char *str;
  44. time_t t;
  45. int random_1,idx,count=20;
  46. random_1 =idx=0;
  47. while(count--)
  48. {
  49. srand((unsigned) time(&t));
  50. random_1=rand()%10;
  51. Sleep(1000);
  52. if(random_1 == count)
  53. {
  54. if(random_1%2==0)
  55. str=int_char(random_1*2);
  56. else
  57. str=int_char(random_1*2*-1);
  58. }
  59. else
  60. {
  61. if(random_1%2!=0)
  62. str=int_char(random_1);
  63. else
  64. str=int_char(random_1*-1);
  65. }
  66. while(str[idx]!='\0')
  67. {
  68. fputc(str[idx],fp_3);
  69. idx++;
  70. }
  71. if(idx==0)
  72. {
  73. fputc('0',fp_3);
  74. }
  75. fputc('#',fp_3);
  76. idx=0;
  77. }
  78. fputc('$',fp_3);
  79. up_price++;
  80. fclose(fp_3);
  81. }
  82. char *int_char(int src)
  83. {
  84. char r,*string=(char*)malloc(100*sizeof(char));
  85. int n=src,j=0,temp=0;
  86. if(src<0)
  87. {
  88. n=n*-1;
  89. temp=1;
  90. }
  91. while(n!=0)
  92. {
  93. r=n%10;
  94. string[j++]=(r+48);
  95. n/=10;
  96. }
  97. if(temp==1)
  98. {
  99. string[j++]=45;
  100. }
  101. string[j]='\0';
  102. strrev(string);
  103. return string;
  104. }
  105. void userpage(char *users)
  106. {
  107. int max=5,select=1,loop=1;
  108. user_sec:
  109. while(loop)
  110. {
  111. if(select >6||select ==0)
  112. {
  113. select =1;
  114. }
  115. system("cls");
  116. updating_point();
  117. //system("color 04");
  118. printf(" Stock Guide\n\n");
  119. if(select ==1)
  120. {
  121. printf("-> portfolio\n");
  122. }
  123. else
  124. {
  125. printf(" portfolio\n");
  126. }
  127. if(select == 2)
  128. {
  129. printf("-> watchlist\n");
  130. }
  131. else
  132. {
  133. printf(" watchlist\n");
  134. }
  135. if(select==3)
  136. {
  137. printf("-> stock list\n");
  138. }
  139. else
  140. {
  141. printf(" stock list\n");
  142. }
  143. if(select==4)
  144. {
  145. printf("-> account\n");
  146. }
  147. else
  148. {
  149. printf(" account\n");
  150. }
  151. if(select ==5)
  152. {
  153. printf("-> Transaction Histroy\n");
  154. }
  155. else
  156. {
  157. printf(" Transaction histroy\n");
  158. }
  159. if(select==6)
  160. {
  161. printf("-> EXIT\n");
  162. }
  163. else
  164. {
  165. printf(" EXIT\n");
  166. }
  167. printf("Use the Arrow key's to move and select\n");
  168. int idx=0;
  169. for(idx=0; idx<20; idx++)
  170. {
  171. printf("%d ",array[idx]);
  172. }
  173. switch(_getch())
  174. {
  175. case 'H':
  176. select--;
  177. // goto user_sec;
  178. break;
  179. case 'P':
  180. select++;
  181. // goto user_sec;
  182. break;
  183. case 13:
  184. if(select!=6)
  185. {
  186. user_choice(select,users);;
  187. }
  188. else
  189. {
  190. loop=0;
  191. }
  192. break;
  193. }
  194. }
  195. }
  196. void user_choice(int choice,char *Name)
  197. {
  198. if(choice==1)
  199. portfolio(Name);
  200. else if(choice==2)
  201. watch_list(Name);
  202. else if(choice==3)
  203. stock_list(Name);
  204. else if(choice==4)
  205. my_Account(Name);
  206. else if(choice==5)
  207. trans_sec(Name);
  208. }
  209. void trans_sec(char* Name)
  210. {
  211.  
  212. }
  213. void watch_list(char* Name)
  214. {
  215.  
  216. }
  217. void stock_list(char *Name)
  218. {
  219. system("cls");
  220. FILE*fp;
  221. char x;
  222. list_t *collection=(list_t*)malloc(sizeof(list_t)*5);
  223. int i,arrow=0;
  224. fp=fopen("COMPANY_DATA.txt","r+");
  225. i=0;
  226. char all[10000];
  227. while((x = fgetc(fp)) != EOF)
  228. {
  229. all[i++] = x;
  230. }
  231. all[i] = '\0';
  232. int prev=4,page=0,loop=1,coin=5;
  233. while(loop)
  234. {
  235. system("cls");
  236. updating_point();
  237. inserting_the_data(collection,all,prev,page,i);
  238. inserting_the_data(collection,all,prev,page,i);
  239. prev=page;
  240. printf(" <<<<<<<<<<<<<<<<<<<Stock list>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n");
  241. printf("COMPANY_NAME ||STARTING_PRICE || VOLUME || MARKET ||cur_price");
  242. printf("\n%s|%d|%d|%d|%d",collection[0].name,collection[0].start_price,collection[0].volume,collection[0].market,array[(page*5)+0]);
  243. if(arrow==0)printf("<-");
  244. printf("\n%s|%d|%d|%d|%d",collection[1].name,collection[1].start_price,collection[1].volume,collection[1].market,array[(5*page)+1]);
  245. if(arrow==1)printf("<-");
  246. printf("\n%s|%d|%d|%d|%d",collection[2].name,collection[2].start_price,collection[2].volume,collection[2].market,array[(5*page)+2]);
  247. if(arrow==2)printf("<-");
  248. printf("\n%s|%d|%d|%d|%d",collection[3].name,collection[3].start_price,collection[3].volume,collection[3].market,array[(5*page)+3]);
  249. if(arrow==3)printf("<-");
  250. printf("\n%s|%d|%d|%d|%d",collection[4].name,collection[4].start_price,collection[4].volume,collection[4].market,array[(5*page)+4]);
  251. if(arrow==4)printf("<-");
  252. printf("\nGo Back");
  253. if(arrow==5)printf("<-");
  254. x=_getch();
  255. switch(x)
  256. {
  257. case 72:
  258. arrow--;
  259. break;
  260. case 80:
  261. arrow++;
  262. break;
  263. case 75:
  264. page--;
  265. break;
  266. case 77:
  267. page++;
  268. break;
  269. case 13:
  270. if(arrow==5)
  271. loop=0;
  272. else
  273. view_stock(collection,arrow,page);
  274. }
  275. if(arrow>5 ||arrow<0)
  276. {
  277. arrow=0;
  278. }
  279. if(page>3 ||page<0)
  280. {
  281. page=0;
  282. arrow =0;
  283. }
  284. }
  285. }
  286. int calcu_eps(int capital,int shares)
  287. {
  288. int out_stan_shares=shares;
  289. return capital/out_stan_shares-14;
  290. }
  291. int calcu_pe(int price,int eps)
  292. {
  293. return eps/price;
  294. }
  295. int calcu_Div(int price)
  296. {
  297. int dividend_yield=7;
  298. return price/dividend_yield;
  299. }
  300. void view_stock(list_t*Data,int current,int page)
  301. {
  302. char x;
  303. int EPS,PE,Dividend,choice=0,loop=1;
  304. EPS=calcu_eps(Data[current].market,Data[current].volume);
  305. PE=calcu_pe(Data[current].start_price,EPS);
  306. Dividend=calcu_Div(Data[current].start_price);
  307. while(loop)
  308. {
  309. system("cls");
  310. updating_point();
  311. printf("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<View Stock>>>>>>>>>>>>>>>>>>>>>\n\n");
  312. printf("<<<<<<<<<<<<<<<<<<<<<<<<Company Details>>>>>>>>>>>>>>>>>>>>\n");
  313. printf("\t\t\t\t\tFundamentals Analysis\n");
  314. printf("Name:%s \t\t\t\t",Data[current].name);
  315. printf("EPS:%d\n",EPS);
  316. printf("No.of.Shares:%d \t\t\t",Data[current].volume);
  317. printf("PE :%d\n",PE);
  318. printf("Starting price:%d\t\t\t",Data[current].start_price);
  319. printf("Dividend:%d\n",Dividend);
  320. printf("Market Capital:%d\n",Data[current].market);
  321. printf("Current Price:%d\n",array[(5*page)+current]);
  322. printf("\n\n\n");
  323. fun(0,choice);
  324. printf("View current graph\n");
  325. fun(1,choice);
  326. printf("Go back\n");
  327. x= _getch();
  328. switch(x)
  329. {
  330. case 'H':
  331. choice--;
  332. break;
  333. case 'P':
  334. choice++;
  335. break;
  336. case 13:
  337. if(choice==1)
  338. loop=0;
  339. else
  340. graph_section(Data[current].name,Data[current].volume,Data[current].start_price,page,current);
  341. }
  342. if(choice<0 ||choice>1)
  343. {
  344. choice=1;
  345. }
  346. }
  347. }
  348. int* whole_data(int st_price,int page,int CURRENT,int *length)
  349. {
  350. FILE *fp;
  351. char x='k',Data[10000],max_array[3];
  352. fp=fopen("Prices_list.txt","a+");
  353. int pos=0,index=0,new_arr[1000],price=0,var=(5*page)+CURRENT,value=0;
  354. while(value<ind_pos)
  355. {
  356. index=0;
  357. while(x!='$')
  358. {
  359. x=fgetc(fp);
  360. Data[index]=x;
  361. index++;
  362. }
  363. Data[index]='\0';
  364. int cur=0,low=0;
  365. while(cur!=var && low<index)
  366. {
  367. if(Data[low]=='#')
  368. {
  369. cur++;
  370. }
  371. low++;
  372. }
  373. cur=0;
  374. while(Data[low]!='#')
  375. {
  376. max_array[cur++]=Data[low];
  377. low++;
  378. }
  379. max_array[cur]='\0';
  380. int v;
  381. v=char_to_int(max_array);
  382. new_arr[value]=v;
  383. value++;
  384. pos++;
  385. x='k';
  386. }
  387. int *r=&value;
  388. *length=*r;
  389. return new_arr;
  390. }
  391. void graph_section(char *name,int shares,int st_price,int page,int CURRENT)
  392. {
  393. system("cls");
  394. char *str;
  395. int len,*data,pos=0,x1,x2,y1,y2;
  396. data=whole_data(st_price,page,CURRENT,&len);
  397. if(len!=0)
  398. {
  399. int gd = DETECT,gm;
  400. int x1,x2,y1,y2,cur=0;
  401. x1=x2=y1=y2=cur=0;
  402. initgraph(&gd, &gm, "C:\\TC\\BGI");
  403. setcolor(YELLOW);
  404. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  405. setcolor(WHITE);
  406. outtextxy(275,0,"Graph");
  407. outtextxy(50,20,"Name : ");
  408. outtextxy(120,20,name);
  409. outtextxy(50,40,"Shares : ");
  410. outtextxy(120,40,int_char(shares));
  411. x1=x2=0;
  412. y1=0;
  413. y2=0;
  414. line(0,50,600,50);
  415. fun_graph(data,len,st_price);
  416. line(0,400,600,400);
  417. _getch();
  418. closegraph();
  419. }
  420. }
  421. void fun_graph(int *data,int len,int st_price)
  422. {
  423. char *str;
  424. str=int_char(st_price);
  425. int pos=0,x1=400,x2=400+data[pos],j=10;
  426. pos++;
  427. int v=10;
  428. while(len--)
  429. {
  430. line(v,x1,j,x2);
  431. outtextxy(j,x1,str);
  432. str=int_char(x2);
  433. j=v;
  434. v+=40;
  435. x1=x2;
  436. x2+=data[pos++];
  437. }
  438. }
  439. void fun(int exp,int act)
  440. {
  441. printf(space);
  442. if(exp==act)
  443. printf("->");
  444. else
  445. printf(" ");
  446. }
  447. void inserting_the_data(list_t *collect,char*Data,int prev,int cur,int range)
  448. {
  449. int idx=0,position=0;
  450. if(cur==0 && prev!=cur)
  451. {
  452. insert(collect,Data,cur+1);
  453. }
  454. else if(cur==1 && prev!=cur)
  455. {
  456. position=cur*5;
  457. while(position--)
  458. {
  459. while(Data[idx]!='$')
  460. {
  461. idx++;
  462. }
  463. idx+=2;
  464. }
  465. insert(collect,Data,idx);
  466. }
  467. else if(cur==2 && prev!=cur)
  468. {
  469. position=10;
  470. while(position--)
  471. {
  472. while(Data[idx]!='$')
  473. {
  474. idx++;
  475. }
  476. idx+=2;
  477. }
  478. insert(collect,Data,idx);
  479. }
  480. else if(cur==3 && prev!=cur)
  481. {
  482. position=15;
  483. while(position--)
  484. {
  485. while(Data[idx]!='$')
  486. {
  487. idx++;
  488. }
  489. idx+=2;
  490. }
  491. insert(collect,Data,idx);
  492. }
  493. }
  494. void insert(list_t *collect,char *Data,int pos)
  495. {
  496. int count=5,idx=0,range=0;
  497. char temp[100]= {0};
  498. while(range<count)
  499. {
  500. idx=0;
  501. while(Data[pos]!='#')
  502. {
  503. temp[idx++]=Data[pos];
  504. pos++;
  505. }
  506. temp[idx]='\0';
  507. pos++;
  508. strcpy(collect[range].name,temp);
  509. idx=0;
  510. while(Data[pos]!='#')
  511. {
  512. temp[idx]=Data[pos++];
  513. idx++;
  514. }
  515. temp[idx]='\0';
  516. collect[range].start_price=char_to_int(temp);
  517. idx=0;
  518. pos++;
  519. while(Data[pos]!='$')
  520. {
  521. temp[idx]=Data[pos++];
  522. idx++;
  523. }
  524. temp[idx]='\0';
  525. pos+=2;
  526. collect[range].volume=char_to_int(temp);
  527. collect[range].market=((collect[range].start_price)*(collect[range].volume))*2;
  528. range++;
  529. }
  530. }
  531. void my_Account(char *Name)
  532. {
  533. printf("My Account\n\n");
  534. printf("Name :%s\n",Name);
  535. printf("Starting Investment:50,000\n");
  536. // printf("Stock Value :%d",);
  537.  
  538. }
  539. void portfolio(char *Name)
  540. {
  541.  
  542. }
  543. int main()
  544. {
  545. printf("WELCOME\n");
  546. printf(" TO \n");
  547. printf(" STOCK GUIDE \n");
  548. printf("Press any Key\n");
  549. _getch();
  550. Main_page();
  551. return 0;
  552. }
  553. void updating_point()
  554. {
  555. char Data[1000],x,max[3];
  556. int i,pos=0,in=0,count=0,idx=0;
  557. FILE *fp1,*fp;
  558. if((fp1=fopen("COMPANY_DATA.txt","r"))==NULL)
  559. {
  560. fp1=fopen("COMPANY_DATA.txt","w");
  561. char data[]="|venkys#20#500000$|satin#10#2500000$|ultratech#15#2000000$|polaris#17#250000$|Aditya vision#20#700000$|Mrf#35#1000000$|page#25#350000$|Ashok leyland#45#100000$|Tata#15#750000$|jio#40#100000$|kakatiya Cement#33#750000$|Coasboard Industries#27#500000$|Electrotham industries#21#210000$|Eichers#77#1000000$|Rana Sugar#13#500000$|Alkai Metals#39#450000$|Amazon#61#8500000$|JustDial#69#7200000$|Adobe#77#900000$|infoys#55#6500000$";
  562. i=0;
  563. while(data[i]!='\0')
  564. {
  565. x=data[i];
  566. fputc(x,fp1);
  567. i++;
  568. }
  569. fclose(fp1);
  570.  
  571. }
  572. if(ind_pos==0)
  573. {
  574. int new_arr[20]= {20,10,15,17,20,35,25,45,15,40,33,27,21,77,13,39,61,69,77,55};
  575. for(idx=0; idx<20; idx++)
  576. {
  577. array[idx]=new_arr[idx];
  578. }
  579. }
  580. if(ind_pos<up_price)
  581. {
  582. fp=fopen("Prices_list.txt","a+");
  583. idx= pos=in=count =0;
  584. x='k';
  585. while(count<ind_pos)
  586. {
  587. x=fgetc(fp);
  588. if(x=='$')
  589. {
  590. count++;
  591. }
  592. }
  593. count=0;
  594. if(ind_pos!=0)
  595. {
  596. x='k';
  597. }
  598. while(x!='$')
  599. {
  600. x=fgetc(fp);
  601. Data[idx]=x;
  602. idx++;
  603. }
  604. Data[idx]='\0';
  605. while(in<idx)
  606. {
  607. in++;
  608. while(Data[in]!='#' && Data[in]!='$')
  609. {
  610. max[pos++]=Data[in];
  611. in++;
  612. }
  613. if(Data[in]=='$')
  614. {
  615. in++;
  616. }
  617. else
  618. {
  619. if(pos==0)
  620. {
  621. max[pos++]='0';
  622. }
  623. max[pos]='\0';
  624. pos=0;
  625. array[count]+=char_to_int(max);
  626. count++;
  627. }
  628. }
  629. ind_pos++;
  630. pthread_t tid_2;
  631. pthread_create(&tid_2, NULL, myThreadFun, (void*)1);
  632. }
  633. check_null();
  634. }
  635. void check_null()
  636. {
  637. int idx;
  638. for(idx=0; idx<20; idx++)
  639. {
  640. if(array[idx]<0)
  641. array[idx]=0;
  642. }
  643. }
  644. int Main_page()
  645. {
  646. updating_point();
  647. FILE *fp;
  648. char choice,x;
  649. char users[100];
  650. char username[100];
  651. char password[100];
  652. int i=0;
  653. pthread_t tid;
  654. pthread_create(&tid, NULL, myThreadFun, NULL);
  655. main_sec:
  656. system("cls");
  657. while(1)
  658. {
  659. fflush(stdin);
  660. printf("Helix\n");
  661. printf("1)login\n");
  662. printf("2)signup\n");
  663. printf("3)exit");
  664. choice=_getch();
  665. if(choice== 49 || choice ==50 ||choice==51)
  666. break;
  667. else
  668. {
  669. printf("\nEnter valid choice\n");
  670. printf("press any key\n");
  671. _getch();
  672. system("cls");
  673. }
  674. }
  675. if(choice==49)
  676. {
  677. char x,*tempstr;
  678. char accountsDB[100];
  679. system("cls");
  680. printf("Login \n");
  681. printf("Username:");
  682. scanf("%s",username);
  683. printf("\n");
  684. i=0;
  685. while(username[i] != '\0')
  686. {
  687. users[i] = username[i];
  688. i++;
  689. }
  690. users[i] = '\0';
  691. i=0;
  692. printf("Password:");
  693. while ((x = _getch()) != '\r')
  694. {
  695. printf("*");
  696. password[i++] = x;
  697. }
  698. password[i] = '\0';
  699. i = 0;
  700. strcat(username, password);
  701. fp = fopen("PROJECT_DATA_FILE.txt","r");
  702. while((x = fgetc(fp)) != EOF)
  703. {
  704. accountsDB[i++] = x;
  705. }
  706. accountsDB[i] = '\0';
  707. fclose(fp);
  708. if(NULL == strstr(accountsDB, username))
  709. {
  710. printf("\n\n"space space"*Username or password is wrong");
  711. _getch();
  712. goto main_sec;
  713. }
  714. else
  715. {
  716. tempstr = strstr(accountsDB, username);
  717. }
  718. i=0;
  719. while(username[i]!='\0')
  720. {
  721. if(username[i]!=tempstr[i])
  722. break;
  723.  
  724. i++;
  725. }
  726. if(i==strlen(username))
  727. {
  728. userpage(users);
  729. goto main_sec;
  730. }
  731. else
  732. {
  733. printf("\n\n*Username or password is wrong");
  734. _getch();
  735. goto main_sec;
  736. }
  737. }
  738. if(choice ==50)
  739. {
  740. system("cls");
  741. printf("Signup\n");
  742. printf("Username:");
  743. scanf("%s",username);
  744. i=0;
  745. while((x = username[i]) != '\0')
  746. {
  747. if(x == '|' || x == '#' || x == '$')
  748. {
  749. printf("\n*Username must not contain special characters like |, #, $ etc.");
  750. _getch();
  751. goto main_sec;
  752. }
  753. i++;
  754. }
  755. char accountsDB[100];
  756. fp = fopen("PROJECT_DATA_FILE.txt","r");
  757. i = 0;
  758. while((x = fgetc(fp)) != EOF)
  759. {
  760. accountsDB[i++] = x;
  761. }
  762. fclose(fp);
  763. char temp_pass[100];
  764. if(NULL == strstr(accountsDB, username))
  765. {
  766. i=0;
  767. printf("Password:");
  768. while ((x = _getch()) != '\r')
  769. {
  770. printf("*");
  771. password[i++] = x;
  772. }
  773. password[i] = '\0';
  774. printf("\nRe-Enter password:");
  775. i = 0;
  776. while((x = _getch()) != '\r')
  777. {
  778. printf("*");
  779. temp_pass[i++] = x;
  780. }
  781. temp_pass[i]='\0';
  782. if(strcmp(temp_pass,password)==0)
  783. {
  784. i = 0;
  785. fp = fopen("PROJECT_DATA_FILE.txt","a");
  786. fputc('|',fp);
  787. while((x = username[i]) != '\0')
  788. {
  789. fputc(x,fp);
  790. i++;
  791. }
  792. i = 0;
  793. while((x = password[i]) != '\0')
  794. {
  795. fputc(x,fp);
  796. i++;
  797. }
  798. fputc('$', fp);
  799. fputc('1', fp);
  800. fputc('#', fp);
  801. fputc('1', fp);
  802. fclose(fp);
  803. printf("\n\nSign up successful");
  804. _getch();
  805. goto main_sec;
  806. }
  807. else
  808. {
  809. printf("\n\n*Passwords do not match, try again");
  810. _getch();
  811. goto main_sec;
  812. }
  813. }
  814. else
  815. {
  816. printf("\n*Username is already taken");
  817. _getch();
  818. goto main_sec;
  819. }
  820. }
  821. if(choice==51)
  822. {
  823. system("cls");
  824. printf("Exit\n\n");
  825. printf("Are You Sure Want to Exit\n");
  826. printf("Enter y/n\n");
  827. x=_getch();
  828. if(x=='n'||x=='N')
  829. goto main_sec;
  830. else
  831. {
  832. printf("Thank u for visiting\n");
  833. }
  834. }
  835. }
  836. int char_to_int(char*num)
  837. {
  838. int length=strlen(num);
  839. int var=1;
  840. int i,c=0,temp;
  841. for(i=0; i<length; i++)
  842. {
  843. if(i==0 && num[i]==45 )
  844. {
  845. var=-1;
  846. }
  847. else
  848. {
  849. temp=(num[i]-48);
  850. c=c*10+temp;
  851. }
  852. }
  853. c=c*var;
  854. return c;
  855. }
Add Comment
Please, Sign In to add comment