Here is the code snippet:
SPSite spsite = new SPSite("http://mysite/");
SPWeb spweb = spsite.OpenWeb();
SPList splist = spweb.Lists["mylist"];
SPViewCollection spviewcollection = splist.Views;
string strMyView= "MyView";
System.Collections.Specialized.StringCollection viewColumnFields =
new System.Collections.Specialized.StringCollection();
viewColumnFields.Add("Title");
viewColumnFields.Add("Age");
string filter =
//show all the items which has age less than 100
spviewcollection.Add(strMyView, viewColumnFields, filter, 100, true, true);
//This will add the view in the list and make it the default view
spview.Scope = SPViewScope.Recursive;
//With this all the items inside the folders will be displayed
spweb.Update();