PROBLEME C#

1. Sa se scrie o aplicatie care afiseaza valoarea constantei PI.(pi)
using System; namespace pi { /// <summary> /// Summary desciption for Class1. /// </summary> class Class1 { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { // //TODO: Addcode to start aplication here // Console.WriteLine(Math.PI); } } }

2. Sa se afiseze valoarea expresiei 18+x-5, unde x este de tip int si este initializat cu 10.(ecuatie)
using System; namespace ecuatie

Console. Sa se scrie o aplicatie care declaravariabilele a si b tip int. pe a cu 3. } } 3.(produs) using System.{ } ///<summary> /// Summary descriptiom for Class1. /// </summary> class Class1 { ///<summary> /// The main entry point for the aplication. b=987654321. iar pe b cu 987654321 si apoi afiseaza valoarea produsului dintre a si b.WriteLine(18+x-5).WriteLine ((uint)a*b). } . namespace produs { /// <summary> /// Summary desciption for Class1. /// </summary> [STAThread] static void Main(string[] args) { // //TODO: Add code start applicatin here // int x = 10. /// </summary> [STAThread] static void Main(string[] args) { // //TODO: Addcode to start aplication here // int a=3. initializandu-le. Console. /// </summary> class Class1 { /// <summary> /// The main entry point for the application.

/// </summary> class Class1 { /// <summary> /// The main entry point for the application.(semn) using System.2F. namespace semn { /// <summary> /// Summary desciption for Class1. Aplicatia va afisa True daca expresia 3*x*x-7*x+4>0 pentru x=1. Console. } } } .} } 4.WriteLine(3 * x * x . Sa se scrie o aplicatie care stabileste semnul expresiei 3*x*x-7*x+4 pentru x=1.2 si False altfel.7 * x + 4 > 0).2. /// </summary> [STAThread] static void Main(string[] args) { // //TODO: Addcode to start aplication here // float x=1.

/// </summary> [STAThread] static void Main(string[] args) .(cifre) using System. unde n este o variabila de tip int initializata cu 6. } } } 6.3m * (decimal)x + 1. /// </summary> [STAThread] static void Main(string[] args) { // //TODO: Addcode to start aplication here // double x = .5. /// </summary> class Class1 { /// <summary> /// The main entry point for the application. namespace cifre { /// <summary> /// Summary desciption for Class1. Sa se scrie o aplicatie care sa testeze daca valoarea 0. namespace test { /// <summary> /// Summary desciption for Class1. este solutie a ecuatiei x*x-3*m*x+1.5. Sa se scrie o aplicatie care afiseaza cu 15 cifre valoarea expresiei 1/(n+1). Console.25m == 0).(test) using System.5.25m=0.WriteLine((decimal)x * (decimal)x . de tip double. /// </summary> class Class1 { /// <summary> /// The main entry point for the application.

2005. Console. Console. .WriteLine("Anul 2008 este bisect deoarece:"). Console.GetType()).WriteLine("Anul 2005 nu este bisect deoarece:").WriteLine("Anul 2010 nu este bisect deoarece:").(an_bisect) using System. 2005 % 4 == 0 && 2005 % 100 != 0 || 2005 % 400 == 0). Console. 2008. } } } { 7. 2004. Sa se scrie o aplicatie care determina daca un an calendaristic este bisesct sau nu. 2005. 2008 % 4 == 0 && 2008 % 100 != 0 || 2008 % 400 == 0). 2008.WriteLine("{0}%4==0&&{1}%100!=0||{2}%400==0 are valoarea {3}". 2004.(1 / (n + 1)). /// </summary> [STAThread] static void Main(string[] args) { // //TODO: Addcode to start aplication here // Console. 2004 % 4 == 0 && 2004 % 100 != 0 || 2004 % 400 == 0).GetType()). 2005. 2004. 2008.0 / (n + 1)).WriteLine("Anul 2004 este bisect deoarece:"). Console.1.// //TODO: Addcode to start aplication here // int n = 6. Console.0 /(n + 1).WriteLine("1/(6+1)={0}\t{1}".WriteLine("1/(6+1)={0}\t{1}".1 / (n + 1). namespace an_bisect { /// <summary> /// Summary desciption for Class1. /// </summary> class Class1 { /// <summary> /// The main entry point for the application.WriteLine("{0}%4==0&&{1}%100!=0||{2}%400==0 are valoarea {3}". Console.(1. Console.WriteLine("{0}%4==0&&{1}%100!=0||{2}%400==0 are valoarea {3}".

WriteLine("max({0}. /// </summary> class Class1 { /// <summary> /// The main entry point for the application.Console.WriteLine("{0}%4==0&&{1}%100!=0||{2}%400==0 are valoarea {3}". } } } . Sa se scrie o aplicatie care afiseaza maximul dintre valorile a doua variabile. 2010. 2010. } } } 8. namespace max { /// <summary> /// Summary desciption for Class1. una de tip int si una de tip double. 2010. i. i > d ? i : d). 2010 % 4 == 0 && 2010 % 100 != 0 || 2010 % 400 == 0).{1})={2}". Console. d.(max) using System. double d = -10. /// </summary> [STAThread] static void Main(string[] args) { // //TODO: Addcode to start aplication here // int i = 10.

namespace interval { /// <summary> /// Summary desciption for Class1. x.9. Se vor testa valorile 4 si -4. Console. /// </summary> class Class1 { /// <summary> /// The main entry point for the application. Sa se scrie o aplicatie care evalueaza expresii ce contin operatoul de indexare pentru a accesa elementele unui tablou unidimensional. y.(interval) using System. /// </summary> [STAThread] static void Main(string[] args) { // //TODO: Addcode to start aplication here // int x = 4.WriteLine("{0}>=-3 && {1}<=7 are valoarea:{2}". /// </summary> class Class1 { /// <summary> /// The main entry point for the application. int y = -4. Sa se scrie o aplicatie care testeza apartenenta valorilor variadilei x la intervalul [-3. y >= -3 && y <= 7). } } } 10. /// </summary> . x. Console. namespace interval { /// <summary> /// Summary desciption for Class1. x >= -3 && x <= 7).7].(index) using System.WriteLine("{0}>=-3 && {1}<=7 are valoarea:{2}". y.

WriteLine("tab [0]={0}".WriteLine("tab [3*{0}={1}]={2}".5.WriteLine("tab [tab1[1]+4]={0}".3."). Console.i.lg. tab[lg]).9}.7.6.tab[0]).tab[tab1[1]+4]).tab[3*i+j]). Console. int j=-3.WriteLine("long [] tab1={0.WriteLine("tab [7]={0}". Console.8.WriteLine("double [] tab={1.6.9}. Console. Console. Console.j. long[] tab1 ={ 0.2.2.3.8.WriteLine("tab [{0}]={1}". } . 1 }.tab[7]).1}.4. Console. long lg=1. int i=2.} } [STAThread] static void Main(string[] args) { // //TODO: Addcode to start aplication here // double [] tab={1.4.").7.5.

Sign up to vote on this title
UsefulNot useful