We know that every custom object ends with __c . Here we are going through all objects present in Salesforce org and if Object contains __c then we are considering that object as custom object and print that object local name using getLocalName method .
for(Schema.sObjectType info : Schema.getGlobalDescribe().values()){
Schema.DescribeSObjectResult describedInfo = info.getDescribe();
String objectName = describedInfo.getLocalName();if(objectName.contains('__c')){
System.debug('Object Name '+objectName );}}
The about code will give you all custom objects . Check how to find all the Standard Objects in Salesforce. Also here you can find how to filter Standard objects in APEX.