2² + 4² + 6² +… + n² C-program for determining the sum of This series
HSC ICT Subject has a chapter called Programming Language. Today we will talk about a programming programming language. Today’s program is the topic of discussion “2² + 4² + 6² +… + n² C-program for determining the sum of This series” So, Let’s start..
2² + 4² + 6² +... + n² C-program for determining the sum of This series
2² + 4² + 6² +… + n² C-program for determining the sum of This series
Equipment required:
A personal computer. However, now the program can be run using the mobile app.
Required software:
Any one compiler program. E.g .: Turbo C ++
Presenting results:
Follow the procedure:
Click on Start.
Click on Programs / All programs.
Click on Turbo C ++ 4.5.
Click on Turbo C ++.
Start >> Programs / All programs >> Turbo C ++ 4.5 >> Turbo C ++
Then we will see the editor window of Turbo C ++.
Program Code:
#INCLUDE
#INCLUDE
INT MAIN ()
{
INT I, N, SUM=0;
PRINTF(“ENTER THE VALUE OF N=”);
SCANF(“%D”,&N);
FOR(I=2;I<=N;I=I+2)
SUM=SUM+(I*I);
PRINTF(“SUMMATION IS:%D”,SUM);
GETCH ();
}
Save program:
Click on File menu and click on Save / Save As. Then the Save As dialog box appears.
Let’s type any name in the Text box of File Name.
Select C ++ Source (* .c; *. Cpp) from the drop down list of List Files of Type.
Let’s select Drive from Drives.
Finally click on OK.
Run the program:
To run the program, click on Run from the Debug menu or press Ctrl + F9 key.
Result: If we enter the required value by entering the program code correctly, we will get the correct result.
আমরা সংবিধান ও জনমতের প্রতি শ্রদ্ধাশীল। তাই ধর্ম ও রাষ্ট্রবিরোধী এবং উষ্কানীমূলক কোনো বক্তব্য না করার জন্য পাঠকদের অনুরোধ করা হলো। কর্তৃপক্ষ যেকোনো ধরণের আপত্তিকর মন্তব্য মডারেশনের ক্ষমতা রাখেন।