{"id":24438717,"url":"https://github.com/anower77/c-sharp-program","last_synced_at":"2025-10-14T02:16:18.982Z","repository":{"id":185242804,"uuid":"591723547","full_name":"Anower77/C-sharp-Program","owner":"Anower77","description":"1. 1(3)+2(3)+3(3)+...n find sum series","archived":false,"fork":false,"pushed_at":"2023-01-29T09:22:44.000Z","size":278,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-14T02:16:18.466Z","etag":null,"topics":["c-sharp","character-recognition","factorial-calculation","fibonacci-numbers","prime","prime-numbers","quadratic-equations","series","summation","swapping-numbers","triangle","triangle-area-calculate"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anower77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-21T17:02:17.000Z","updated_at":"2023-03-21T15:26:58.000Z","dependencies_parsed_at":"2023-08-01T08:03:32.361Z","dependency_job_id":null,"html_url":"https://github.com/Anower77/C-sharp-Program","commit_stats":null,"previous_names":["anower77/c-sharp-program"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Anower77/C-sharp-Program","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anower77%2FC-sharp-Program","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anower77%2FC-sharp-Program/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anower77%2FC-sharp-Program/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anower77%2FC-sharp-Program/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anower77","download_url":"https://codeload.github.com/Anower77/C-sharp-Program/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anower77%2FC-sharp-Program/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017673,"owners_count":26086125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","character-recognition","factorial-calculation","fibonacci-numbers","prime","prime-numbers","quadratic-equations","series","summation","swapping-numbers","triangle","triangle-area-calculate"],"created_at":"2025-01-20T19:17:34.594Z","updated_at":"2025-10-14T02:16:18.943Z","avatar_url":"https://github.com/Anower77.png","language":"C#","readme":"## 1. which number is greatest among three numbers\n___\n\n```c#\nusing System;  \npublic class Exercise8  \n{  \n    public static void Main()\n{\n    int num1, num2, num3;\n\n// input data\n    Console.Write(\"Input the 1st number :\");\n    num1 = Convert.ToInt32(Console.ReadLine());\n    Console.Write(\"Input the  2nd number :\");\n    num2 = Convert.ToInt32(Console.ReadLine());\n    Console.Write(\"Input the 3rd  number :\");\n    num3 = Convert.ToInt32(Console.ReadLine());\n \n // condition\n  if (num1 \u003e num2)\n    {\n        if (num1 \u003e num3)\n        {\n            Console.Write(\"1st Number is the greatest. \\n\\n\");\n        }\n        else\n        {\n            Console.Write(\"3rd Number is the greatest. \\n\\n\");\n        }\n    }\n    else if (num2 \u003e num3)\n        Console.Write(\"2nd Number is the greatest. \\n\\n\");\n    else\n        Console.Write(\"3rd Number is the greatest. \\n\\n\");\n}\n}\n\n\n\n```\n\n## Example\n```mermaid\ngraph TD;\n    A--\u003eB;\n    A--\u003eC;\n    B--\u003eD;\n    C--\u003eB;\n    \n    B--\u003eD;\n    C--\u003eC;\n    C--\u003eA;\n    A--\u003eD;\n```\n\n\n\n\n\n## 2. Triabgle area calculate\n___\n\n```c#\nusing System;\npublic class AreaOfTriangle\n{\n    public static void Main()\n    {\n        Console.Write(\"Enter the Base:\");\n        double Base = Convert.ToDouble(Console.ReadLine());\n        Console.Write(\"Enter the Height:\");\n        double Height = Convert.ToDouble(Console.ReadLine());\n        \n        double Area = (Base * Height) / 2;\n\n        Console.Write(\"Area of a Triangle = \" + Area);\n        Console.ReadKey();\n    }\n}\n\n```\n\n\n## 3. Swapping number\n___\n\n```c#\nusing System;\nnamespace swappin_number\n{\n    class swapping_number\n    {\n        public static void Main(string[] args)\n        {\n            int a = 5;\n            int b = 10;\n            int c = a;\n            a = b;\n            b = c;\n            Console.WriteLine(\"swapping a :\" + a);//swapping : 10\n            Console.WriteLine(\"swapping b :\" + b);//swapping : 5\n        }\n    }\n}\n\n\n```\n\n## 4. Quadratic equation ax2+bx+c=0\n___\n\n```c#\nusing System;  \npublic class Exercise11  \n{  \n    public static void Main()\n{\n//   variable declaration\n   int a,b,c;\n   double d, x1,x2;\n    Console.Write(\"Input the value of a : \");\n    a = Convert.ToInt32(Console.ReadLine());\n    Console.Write(\"Input the value of b : \");\n    b = Convert.ToInt32(Console.ReadLine());\n    Console.Write(\"Input the value of c : \");\n    c = Convert.ToInt32(Console.ReadLine());\n\n// quadratic law\n   d=b*b-4*a*c;\n   if(d==0)\n   {\n     Console.Write(\"Both roots are equal.\\n\");\n     x1=-b/(2.0*a);\n     x2=x1;\n     Console.Write(\"First  Root1= {0}\\n\",x1);\n     Console.Write(\"Second Root2= {0}\\n\",x2);\n   }\n   else if(d\u003e0)\n\t{\n\t   Console.Write(\"Both roots are real and diff-2\\n\");\n\n\t   x1=(-b+Math.Sqrt(d))/(2*a);\n\t   x2=(-b-Math.Sqrt(d))/(2*a);\n\n\t   Console.Write(\"First  Root1= {0}\\n\",x1);\n\t   Console.Write(\"Second Root2= {0}\\n\",x2);\n\t}\n\telse\n\t    Console.Write(\"Root are imeainary;\");\n}\n}\n\n\n```\n\n\n## 5. Prime number 1 to 50\n___\n\n```c#\nusing System;  \npublic class Exercise34 \n{  \n    public static void Main()\n{\n    //variable declaration\n    int num, i, ctr, first_num, second_num;\n\t\n\t  \t\n    //Input prime number\n    Console.Write(\"Input 1st number: \");\n    first_num = Convert.ToInt32(Console.ReadLine()); \t\n    Console.Write(\"Input 2nd number: \");\n    second_num = Convert.ToInt32(Console.ReadLine()); \t\n    Console.Write(\"Prime numbers between {0} and {1} are : \\n\",first_num,second_num);\n  \n  \n    //Condition \u0026 Loop\n    for(num = first_num; num \u003c= second_num; num++)\n       {\n         ctr = 0;\n\n         for(i = 2; i \u003c= num/2; i++)\n            {\n             if(num%i == 0){\n                 ctr++;\n                 break;\n             }\n        }\n        \n         if(ctr==0 \u0026\u0026 num!= 1)\n             Console.Write(\"{0} \",num);\n    }\n    Console.Write(\"\\n\"); \n  } \n} \n\n```\n\n## 6. Fibonacci series\n___\n\n```c#\nusing System;  \n  public class FibonacciExample  \n   {  \n     public static void Main(string[] args)  \n      {  \n         int n1=0,n2=1,n3,i,number;    \n         Console.Write(\"Enter the number of elements: \");    \n         number = int.Parse(Console.ReadLine());  \n         Console.Write(n1+\" \"+n2+\" \"); //printing 0 and 1    \n        \n        \n         for(i=2; i\u003cnumber; ++i) //loop starts from 2 because 0 and 1 are already printed    \n         {    \n          n3=n1+n2;    \n          Console.Write(n3+\" \");    \n          n1=n2;    \n          n2=n3;    \n         }    \n      }  \n   } \n\n\n```\n\n\n## 7. Factorial number\n___\n\n```c#\n// C# program to find factorial\n// of given number\nusing System;\n \nclass Test {\n    // method to find factorial\n    // of given number\n    static int factorial(int n)\n    {\n        if (n == 0)\n            return 1;\n \n        return n * factorial(n - 1);\n    }\n \n    // Driver method\n    public static void Main()\n    {\n        int num = 5;\n        Console.WriteLine(\"Factorial of \"\n                          + num + \" is \" + factorial(5));\n    }\n}\n\n```\n\n\n## 8. Check any prime number\n___\n\n```c#\nusing System;  \n  public class PrimeNumberExample  \n   {  \n     public static void Main(string[] args)  \n      {  \n          int n, i, m=0, flag=0;    \n          Console.Write(\"Enter the Number: \");    \n          n = int.Parse(Console.ReadLine());  \n          m=n/2;    \n          for(i = 2; i \u003c= m; i++)    \n          {    \n           if(n % i == 0)    \n            {    \n             Console.Write(\"Number is not Prime.\");    \n             flag=1;    \n             break;    \n            }    \n          }    \n          if (flag==0)    \n           Console.Write(\"Number is Prime.\");       \n     }  \n   }  \n\n```\n\n\n## 9. Character,  number, special character\n___\n\n```c#\nusing System;\nnamespace characters_specialChar_number\n{\n    class characters_specialChar_number\n    {\n        public static void Main(string[] args)\n        {\n            string str;\n            int alphabet, number, specialChar, i, l;\n            alphabet = number = specialChar = i = 0;\n            Console.Write(\"Write Somethig : \");\n            str = Console.ReadLine();\n            l = str.Length;\n            \n            \n            while(i \u003c l)\n            {\n                if((str[i]\u003e='a' \u0026\u0026 str[i]\u003c='z') || (str[i]\u003e='A' \u0026\u0026 str[i]\u003c='Z'))\n                {\n                    alphabet++;\n                }\n                else if(str[i]\u003e='0' \u0026\u0026 str[i]\u003c='9')\n                {\n                    number++;\n                }\n                else\n                {\n                    specialChar++;\n                }\n                i++;\n            }\n            Console.WriteLine(\"Aphabet is = {0}\\n \", alphabet);\n            Console.WriteLine(\"Number is = {0}\\n\" , number);\n            Console.WriteLine(\"Special Character is = {0}\\n\", specialChar);\n        }\n    }\n}\n\n```\n\n\n## 10. 2+4+6+...n find sum series\n___\n\n```c#\nusing System;\n\nclass Program {\n    static void Main(string[] args) {\n        int n = 10; // change this to the desired value of n\n        int result = 0;\n        for (int i = 2; i \u003c= n; i += 2) {\n            result += i;\n        }\n        Console.WriteLine(\"Summation series: 2+4+6+...+\" + n + \" = \" + result);\n    }\n}\n\n\n```\n\n## 11. 1+3+5+...n find sum series\n___\n\n```c#\nusing System;\n\nclass Program {\n    static void Main(string[] args) {\n        int n = 10; // change this to the desired value of n\n        int result = 0;\n        for (int i = 1; i \u003c= n; i += 2) {\n            result += i;\n        }\n        Console.WriteLine(\"Summation series: 1+3+5+...+\" + n + \" = \" + result);\n    }\n}\n\n\n```\n\n\n\n\n\n\n\n## 12. 1+2+3+4+...n find sum series\n___\n\n```c#\nusing System;\n\nclass Program {\n    static void Main(string[] args) {\n        int n = 10; // change this to the desired value of n\n        int result = 0;\n        for (int i = 1; i \u003c= n; i++) {\n            result += i;\n        }\n        Console.WriteLine(\"Summation series: 1+2+3+4+...+\" + n + \" = \" + result);\n    }\n}\n\n\n```\n\n\n\n\n## 13. 1(3)+2(3)+3(3)+...n find sum series\n___\n\n```c#\n\nusing System;\n\nclass Program {\n    static void Main(string[] args) {\n        int n = 3; // change this to the desired value of n\n        int result = 0;\n        for (int i = 1; i \u003c= n; i++) {\n            result += i * i * i;\n        }\n        Console.WriteLine(\"Summation series: 1^3 + 2^3 + 3^3 + ... + \" + n + \"^3 = \" + result);\n    }\n}\n\n\n```\n\n\n\n\n## 14. 1(2)+2(2)+3(2)+...n find sum series\n___\n\n```c#\n\nusing System;\n\nclass Program {\n    static void Main(string[] args) {\n        int n = 3; // change this to the desired value of n\n        int result = 0;\n        for (int i = 1; i \u003c= n; i++) {\n            result += i * i;\n        }\n        Console.WriteLine(\"Summation series: 1^2 + 2^2 + 3^2 + ... + \" + n + \"^2 = \" + result);\n    }\n}\n\n```\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanower77%2Fc-sharp-program","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanower77%2Fc-sharp-program","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanower77%2Fc-sharp-program/lists"}