Results 1 to 3 of 3
  1. #1
    Beusidel's Avatar
    Join Date
    Nov 2018
    Gender
    male
    Posts
    13
    Reputation
    10
    Thanks
    0

    Small task in C language



    Can anyone help me with this?
    I cant find a way to solve this...

  2. #2
    Kappatos's Avatar
    Join Date
    Jun 2015
    Gender
    male
    Posts
    152
    Reputation
    44
    Thanks
    10
    My Mood
    Cool
    Code:
    #include <stdio.h>
    #include <math.h>
    
    double incr = 3;
    
    double calculate(double start,double end) {
    	if (start >= end) {
    		return sqrt(end);
    	}
    	return sqrt(start + calculate(start+incr,end));
    }
    
    int main() {
    	printf("%.*f\n",10, calculate(3,99));
    	return 0;
    }
    Last edited by Kappatos; 10-08-2019 at 08:59 AM.

  3. #3
    Biesi's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    4,950
    Reputation
    353
    Thanks
    8,742
    My Mood
    Twisted
    Code:
    #include <math.h>
    #include <stdio.h>
    
    int main()
    {
        double val = 0;
        for (int i = 99; i >= 3; i -= 3)
        {
            val = sqrt(i + val);
        }
        
        printf("%g\n", val);
        return 0;
    }
    Last edited by Biesi; 10-08-2019 at 06:29 AM.

  4. The Following User Says Thank You to Biesi For This Useful Post:

    sulke (10-08-2019)

Similar Threads

  1. [Release] Multi-Injector | Undetected | With Task Manager | Dual Language++
    By xGanjaGod in forum WarRock - International Hacks
    Replies: 12
    Last Post: 06-09-2013, 11:23 AM
  2. [Release] Multi-Injector | Undetected | With Task Manager | Dual Language++
    By xGanjaGod in forum Piercing Blow Tools
    Replies: 2
    Last Post: 04-22-2013, 12:42 PM
  3. [Release] Multi-Injector | Undetected | With Task Manager | Dual Language++
    By xGanjaGod in forum CrossFire Spammers, Injectors and Multi Tools
    Replies: 10
    Last Post: 04-14-2013, 11:41 AM
  4. [Release] Multi-Injector | Undetected | With Task Manager | Dual Language++
    By xGanjaGod in forum Mission Against Terror Hacks & Cheats
    Replies: 1
    Last Post: 04-14-2013, 05:38 AM
  5. [Release] Multi-Injector | Undetected | With Task Manager | Dual Language++
    By xGanjaGod in forum Blackshot Injectors & Tools
    Replies: 5
    Last Post: 04-14-2013, 01:58 AM