DHT11 Sensor

I am having a problem with my arduino, I’m using a Mega and a DHT11 sensor, the problem comes when the sensor is just giving me a Temperature of 0.00 C and also a humidity of 0.00% always, I am not sure if there is problem with my code but i also tried some online code and they gave me the same problem. My code is as follows:

#include <dht.h>
#define dataPin 7 // Defines pin number to which the sensor is connected
dht DHT; // Creats a DHT object
void setup() {
Serial.begin(9600);
}
void loop() {
int readData = DHT.read11(dataPin); // Reads the data from the sensor
float t = DHT.temperature; // Gets the values of the temperature
float h = DHT.humidity; // Gets the values of the humidity

// Printing the results on the serial monitor
Serial.print("Temperature = “);
Serial.print(t);
Serial.print(” *C “);
Serial.print(” Humidity = “);
Serial.print(h);
Serial.println(” % ");

delay(2000); // Delays 2 secods, as the DHT22 sampling rate is 0.5Hz
}

Use the example, DHTtester, from the library.

Call this function in the setup()

void checkDHT() {
   Serial.println("Testing DHT Working..");
  
   switch(DHT.read(dataPin))
   {
      case DHTLIB_OK:
        Serial.println("DHT: Working");
        break;
  
      case DHTLIB_ERROR_CHECKSUM:
        Serial.println("DHT: Error checksum");
        break;
  
      case DHTLIB_ERROR_TIMEOUT:
        Serial.println("DHT: Reply time too long");
        break;
  
      default:
        Serial.println("DHT: Unknown error");
        break;
    
   }
}

Instead of "int readData = DHT.read11(dataPin); // Reads the data from the sensor"

Work with my DHT11 and my Arduino (also, you can use the DHT11 library).